Rounding of x.xx5 is uncertain, as such numbers are not represented exactly. See also: Why does simple decimal arithmetic give strange results?
The statement n = Math.round(n * 100)/100 converts n to a Number value close to a multiple of 0.01. However, there are some problems. Converting the number to a string (n + “”), does not give trailing zeroes. Rounding numbers that are very close to x.5, for example, Math.round(0.49999999999999992) results 1. ECMAScript Ed. 3.0 introduced Number.prototype.toFixed. There are bugs in JScript’s implementation with certain numbers, for example 0.07. Function numberToFixed returns accurate results that are consistent across implementations where n > 0.