Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ROUND Function unattended result
Message
 
To
23/03/1999 09:40:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00200906
Message ID:
00200927
Views:
10
Hi Marc,

>? X => 1851.07 instead of 1851.08 (Non rounded value is 1851.075)

When you issue:

n = 2
X = INT(X*10^(n+1))/10^(n+1)

You can see that FoxPro reports 1851.074, probably the value is internally stored as 1851.07499999999999999, which makes it print like 1851.075 when you display it on the screen. You get the correct result by setting n to 3 in the lines above and then round the result.

Christof
--
Christof
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform