Paradox Community

Items in pnews.paradox-development

Subject:Re: The difference between currency and number is..
Date:Tue, 12 Jun 2018 04:52:53 +1000
From:Bernie van't Hof <berniev@bje.com.au>
Newsgroups:pnews.paradox-development
What are the results of each calc before and after rounding, prior to calculating the difference?

It smells like number and currency use different calculation/rounding rules.

And if these rules changed version to version, grrrrr....

Sometimes its better to roll your own rounding function. At least then you always know exactly
what the outcome will be.

- Bernie
On 11/6/18 10:07 pm, Steven Green wrote:
> paradox DOS used "banker's rounding".. round to the even side.. 5.5 rounds up to 6, but
4.5 rounds down to 4.. in 
> theory, with large groups of numbers, that's more accurate, but it's not "normal"
> 
> from the beginning, paradox WIN used "banker's rounding, too, but I don't remember where
it stopped.. only 16 bit BDE ??
> 
> -- 
> 
> Steven Green
> Myrtle Beach, South Carolina, USA
> 
> http://www.OasisTradingPost.com
> 
> Collectibles and Memorabilia
> Vintage Lego Sets and Parts
> - and Paradox support, too
> "Bernie van't Hof"  wrote in message news:5b1db87c$1@pnews.thedbcommunity.com...
> 
> Careful which rounding you use, and when:
> 
> 5.5 + 7.5 + 6.5 + 9.5 = 29
> 
> After rounding: 6 + 8 + 7 + 10 = 31
> 
> 9*42.45 = 292.905000000000000 (floating point)
> Does x.round(292.905) become 292.90, or 292.91?
> 
> Exactly what are the rounding rules of p7/9.
> Do currency and data type use different rule?
> 
> And finally..
> 
> A farmer counted 87 cows in the field, but when he rounded them up he had 90.
> 
> - Bernie
> 
> On 9/6/18 3:39 am, Steven Green wrote:
>> correct.. welcome to wonderful world of paradox rounding inconsistencies (sigh)
>>
>>
>> -- 
>>
>> Steven Green
>> Myrtle Beach, South Carolina, USA
>>
>> http://www.OasisTradingPost.com
>>
>> Collectibles and Memorabilia
>> Vintage Lego Sets and Parts
>> - and Paradox support, too
>> "Günter"  wrote in message news:5b1a9953$1@pnews.thedbcommunity.com...
>>
>> Try it out, best with Watches,
>>
>> var
>>    n number
>>    c currency
>> endvar
>>    c=6.9*42.45
>>    c=c.round(2)
>>    n=6.9*42.45
>>    n=n.round(2)
>>    n=n-c
>>    view(n)
>>
>>
>> Seems that currency emulate a old Dek-Table-Add-Maschine, with only 2
>> decimal places 
> 


Copyright © 2004 thedbcommunity.com