Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG in round() function?!?
Message
From
30/01/2004 10:54:09
 
 
To
30/01/2004 10:02:03
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00871732
Message ID:
00872337
Views:
36
Fabio,

One of the workarounds is to round the val() of the str() of the value to round like Vladimir shows in this topic:
http://www.levelextreme.com/wconnect/wc.dll?FournierTransformation~2,15,872317
? ROUND(VAL(STR(147.3250000000,20,15)),2)
? ROUND(VAL(STR(147.32500000000,20,15)),2)
An other one is to round the value to a 'safe' number of decimals before the actual round:
? ROUND(147.32500000000,2) && = 147,32 (wrong)
? ROUND(ROUND(147.32500000000,6),2) && = 147,33 (right)
Maybe there are more workaROUNDs(funny term in this case...).
For me these 2 are enough to deal with the problem.

Willem-Jan van Ede
Vektis BV
Previous
Reply
Map
View

Click here to load this message in the networking platform