Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Integer cents or an arbitrary precision decimal type.


Having worked on a POS system, the issue of using cents alone is if you've got something like "11% rebate" and you need to deal with fractional cents.

The arbitrary precision decimal type should be the default answer for currency until it is shown that the requirements no and at no time in the future will ever require fractional units of the smallest denomination.

As an aside, this may be constrained by the systems that the data is persisted into too... the Buffett Overflow is a real thing ( https://news.ycombinator.com/item?id=27044044 ).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: