Re: ESL - math.e - rounding
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Aug 03, 2005
- 766 views
On Wed, 03 Aug 2005 14:53:22 +0200, Juergen Luethje <j.lue at gmx.de> wrote: >Both functions sometimes return different results, when the (n+1)th >decimal place of x equals 5: > round_half_even() -- rounds to nearest even value > round_half_up() -- always rounds up ( surprise!) > >What do you all think? UK VAT law would allow either, or round_half_down. Another function to consider is knock_on_round(), for example if you have a column of 100 7.125's, then they should be 7.12, 7.13, 7.12... so that the sum of the rounded amounts is 712.50, not 712.00. A clear_knock_on_round function would be an absolute necessity, or a get/set pair for maximum flexibility. Pete