4 ms·
It's a pain in the butt, but I've realized integers are a good practice. Especially due with oddities of conversions and "maths" like Javascript perform.
by czbond 7y ago
It's a pain in the butt, but I've realized integers are a good practice. Especially due with oddities of conversions and "maths" like Javascript perform.
- jonhohle 7y agoFixed precision decimal works as well and may (or may not) require less cognitive load. The nice thing (imho) about using decimal types in code is that since they're uncommon they act as a signal to treat things carefully.
- toast0 7y agoInteger cents is certainly less of a pain in the butt than floating point dollars; I worked on an advertising project where I couldn't convince people to use integer cents, and the result was predictable madness where floating point values didn't line up.