Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to fix rounding bug
Message
From
02/10/2007 14:08:49
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01258001
Message ID:
01258023
Views:
23
Thank you.
I have used round( ...,2) in 150 places in my code and in reports.

Should I re-write all my code and change all reports to use double rounding ?


>
>? ROUND(ROUND(kogus*kogpak*kaubasumma,4),2)
>
>>CREATE CURSOR test( KOGUS N(12,4), KAUBASUMMA N(15,5), kogpak n(9,4) )
>>INSERT INTO test VALUES ( 1, 3.1411, 50 )
>>MESSAGEBOX( ROUND(kogus*kogpak*kaubasumma,2) )

>>
>>Observed: 157.05
>>
>>Expected: 157.06
>>
>>How to fix without changing code and cursor structure ?
Andrus
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform