Comment Comment by raxxorrax browser console:(1.005).toFixed(2)(1.005).toFixed(20) reveals the problem.Math.round(1.005 * 100) // wrongIn the end these conversion errors are not solvable in any language, so you have to "cut off" somewhere. There are different approaches to this.Wasn't there a case where programmers stole the "wrong" cent and wasn't The Office a persiflage on that? parent raxxorrax 6 years ago
(1.005).toFixed(2)
(1.005).toFixed(20) reveals the problem.
Math.round(1.005 * 100) // wrong
In the end these conversion errors are not solvable in any language, so you have to "cut off" somewhere. There are different approaches to this.
Wasn't there a case where programmers stole the "wrong" cent and wasn't The Office a persiflage on that?