in reply to Re: Re: Fixed precision numbers
in thread Fixed precision numbers

That won't work for accounting: you always need to round up.

No, it won't work for maths, but it *will* work for accounting. I think it was merlyn who told me sprintf's rounding was called "Banker's rounding" and showed me why it was important. Google has a lot of information about this phenomenon. In short: halves are rounded towards the nearest even integer, and that solves a lot of problems.

I don't know about international accounting differences, but I don't think biasing rounding up is a good thing to do.

Juerd
- http://juerd.nl/
- spamcollector_perlmonks@juerd.nl (do not use).

Replies are listed 'Best First'.
Re: Re: Re: Re: Fixed precision numbers
by dash2 (Hermit) on Feb 25, 2003 at 23:15 UTC
    Sounds like we need someone with accounting knowledge to deliver wisdom.... Interesting, anyway.

    dave hj~