Normally strings are used, for example: https://developer.uber.com/docs/riders/references/api/v1.2/r...
Guess somebody messed up for this case.
Presumably someone messed up but it wasn't caught in code review.
(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?
Not true at all.
Ruby has BigDecimal: https://ruby-doc.org/stdlib-2.5.1/libdoc/bigdecimal/rdoc/Big...
.NET also has a Decimal type.
I've worked on salary calculation applications and e-commerce platforms, and found that language choice makes a big difference.
If you use numbers directly in exponential form in vanilla javascript, you already get better results.