In general, there is a F-I for rounding to hundredths
js
var rounded = function (Number) {
Return Math.round (ParseFloat (Number) * 100) / 100;
}
works with a bang with single values, but I have a lot of addition and subtraction operations and subtracting n
the number of values, and sometimes skip the values of type 892.299999999 and so on. The question is whether there is a more versatile option for rounding
Answer 1, Authority 100%
maybe: https://jsfiddle.net/ionden/eqj36j1w/
var rounded = function (Number) {
Return + Number.tofixed (2);
}
Console.log (Rounded (29.49999)); //29.5.
Console.log (Rounded (15.75621900432)); //15.76