News for hackers. Stuff that matters.
Re:Building Payments for an Insurance Startup by czbond on Wednesday July 31, 2019 @12:34PM (#20575816)
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.
Re:Building Payments for an Insurance Startup by toast0 on Wednesday July 31, 2019 @04:07PM (#20577922)
Integer 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.
Re:Building Payments for an Insurance Startup by jonhohle on Wednesday July 31, 2019 @12:53PM (#20576011)
Fixed 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.