News for hackers. Stuff that matters.
Re:Ask HN: Currency rounding rules by malux85 on Friday October 07, 2016 @11:51AM (#12661582)
Close, but wrong,

You should store it highest precision, but calculate on a configurable rounding scheme. Some accounting systems always round line items to 2 decimal places, some always round with 3. Some round tax to 3 DP because it's a regulatory requirement.

You would think it doesn't matter much, but in many places it does -- especially businesses that sell many, small priced items, and have invoices that are thousands of lines long .. 2dp/3dp rounding (and rounding on discount % calculations too) can mean that invoices are 10's or hundreds of dollars out.

Store high precision, calculations are configurable.

There are no comments on this comment yet.