JSFiddle - React, Tailwind, and code Playground
JavaScript
var sumOne = 0;
var sumTwo = 0;
[12.993, 12.99, 12.99].forEach(function(number){
sumTwo += roundTwo(number);
})
function roundOne(n){
return (Math.round((n *100))/100);
}
function roundTwo(n){
return +(n.toFixed(2));
}
console.log("sumOne is ", sumOne, " sumTwo is ", sumTwo);