A GCC COBOL status report
A GCC COBOL status report
Posted Feb 16, 2023 7:34 UTC (Thu) by smurf (subscriber, #17840)In reply to: A GCC COBOL status report by mmaug
Parent article: A GCC COBOL status report
Posted Feb 16, 2023 9:56 UTC (Thu)
by geert (subscriber, #98403)
[Link] (6 responses)
Posted Feb 16, 2023 15:39 UTC (Thu)
by Wol (subscriber, #4433)
[Link] (2 responses)
If it's .5, which way do you go (and some places rule that you round to the nearest EVEN (or odd) number).
Okay, fixed decimal doesn't cover rounding rules, but it copes very nicely with correcting different mandatory precisions.
And don't throw significant figures into the mix! When we had the ERM, all calculations had to be done to six significant figures. THAT was fun! Not.
Cheers,
Posted Feb 27, 2023 21:49 UTC (Mon)
by nix (subscriber, #2304)
[Link] (1 responses)
Seriously? So for amounts higher than £9,999.99, you started losing precision?! I'd have expected dp at the very least.
Posted Feb 27, 2023 22:33 UTC (Mon)
by Wol (subscriber, #4433)
[Link]
All exchange rates had to be specified to six figures eactly. Iirc, being about 4 orders of magnitude apart, Sterling to Lire and back wasn't pleasant. Mostly on the display side, not the calculation, admittedly.
And then if you are calculating random exchange rates, rounding before quoting wasn't pleasant either.
Cheers,
Posted Feb 19, 2023 20:15 UTC (Sun)
by ssmith32 (subscriber, #72404)
[Link] (1 responses)
https://www.investopedia.com/terms/d/decimal-trading.asp
So even 1/1000 isn't good enough.
Posted Feb 21, 2023 19:42 UTC (Tue)
by calumapplepie (guest, #143655)
[Link]
Posted Feb 28, 2023 1:38 UTC (Tue)
by mrugiero (guest, #153040)
[Link]
A GCC COBOL status report
When it comes to money, there are strict rounding rules to follow.
E.g. everything is rounded to a cent. Except for fuel prices, which must use an accuracy of 0.1 cent.
Cash amounts may have to be rounded to 5 cent.
1/1000th of a cent might be useful when calculating the BOM price of your new electronics device, when you order SMD resistors by the container ;-)
A GCC COBOL status report
Wol
A GCC COBOL status report
A GCC COBOL status report
Wol
A GCC COBOL status report
A GCC COBOL status report
A GCC COBOL status report
I risk guessing financial institutions do deal with multiple currencies.