The problem is that binary floating point representation of most decimal fractions is not exact. The internal representation of 0.0095
may actually be something like 0.00949999
, so toFixed
rounds down, while 0.1095
might be 0.109500001
, which rounds up.
See Javascript toFixed Not Rounding