Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Round() giving different results
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00452446
Message ID:
00452468
Views:
16
The result you get is affected by set("decimal").
For your particular case you should set decimal to 12 to get the same result.
However it looks like a bug. To reproduce it,try:
*---------------------
set deci to 12
?round(2390.00*.072500,2),round(2390.000000*0.072500,2) &&173.27,173.27
?round(173.275,2), round(173.275000000000,2) &&173.28,173.28
*--------------------

>>>>>>>>>>>>>>>>>>>>>>
If I do the following two commands I get different results. Am I missing something?

?round(2390.00*.072500,2)
173.28

?round(2390.000000*.072500,2)
173.27
Previous
Reply
Map
View

Click here to load this message in the networking platform