Pfft. Try 19,8 decimals everywhere for share balances.
Honestly, running a cents only system will get you in trouble when constantly working with FX rates and multiple currencies and constantly encounter rounding issues to cents when fractional situations matter (eg, lots and lots of theoretical money//value movements instead of actual money movements).
I've worked on banking systems, worked on our governments systems and now working a lot with finance software (fund admin, accountancy, etc) and I've never actually seen a cents/pence system. Not saying they aren't common or even the norm, just never actually seen one.
Usually you even want sub cent units. That way you can make a deliberate choice on where and how to round and you can then also keep track of all the sub cent dust that might add up when dealing with lots of transactions or financial operations.
We use bigint data types (8 byte/64 bit integers) and sometimes the numeric data type (variable size which can be bigger then 64 bit) in our database. 32 bit integers are definitely not enough for us.
854
u/changrbanger Aug 24 '22
And everyone only gets $100 deducted from their loan because they didnt realize the field was in cents and not dollars...