Re: ESL - math.e - rounding

new topic     » goto parent     » topic index » view thread      » older message » newer message

Pete Lomax wrote:

> On Wed, 03 Aug 2005 14:53:22 +0200, Juergen Luethje 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! smile )
>>
>> What do you all think?
>
> UK VAT law would allow either, or round_half_down.

Oh, interesting. Then we probably should have all three functions.

> 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.

I have the same question here as Jason.

> A clear_knock_on_round function would be an absolute necessity, or a
> get/set pair for maximum flexibility.

Regards,
   Juergen

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu