On Wed, Dec 16, 2015 at 1:54 PM, Simon Slavin <slavins at bigfraud.org> wrote:
>
> On 16 Dec 2015, at 3:46pm, Adam Devita <adevita at verifeye.com> wrote:
>
> When writing accounting software, there will be a specific rule for rounding
> attached to each calculation. For instance a process for working out a
> mortgage will include its own instruction "once you have multiplied by the
> number of days, round down to the next dollar". But the rules for working
> out interest rates might state "round to the nearest cent, round half to
> even".
>
Exactly as Simon said, the rules **will** (or at least should) be part
of the requirement. Also, some cases tell you to preserve fractions
until a final rounding. So you will have to go with decimals or
"scale" your integers (multiply them by a power of ten) somewhere.
At least here in Brazil there seems to be a lot of: if it is money
going away {round down as many times as possible} if it is money
coming our way {round up as many times as possible}. I think many
other places will use this too.
--
Bernardo Sulzbach