Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ROUND()
Message
From
09/03/2000 15:39:53
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00342568
Message ID:
00343834
Views:
25
>>As taken from the help file for SET DECIMALS (emphasis is mine);
>>
>>"SET DECIMALS specifies the minimum number of decimal places used to display the results of division, multiplication, and trigonometric and financial functions."
>>
>>I read this to say set decimals is like set century, it has no effect on the actual value but rather effects the display of that value.
>
>Thanks Jim.
>
>What I didn't know and have come to realize is that VFP does not store the value of an expression in the memory variable. It stores the expression and display properties of that expression.

That's exactly what I see, too. To try a really hard one to debug:

SET DECIMAL TO 1
x = 7/74*100
y = ROUND(7/74*100,1)

?x=y && .F.!!!!!
?x-y && 0.0

You have to look at the internal values with DISPLAY MEMORY to see the difference, even though BOTH values when you use ? show 9.5 !!! Enough to drive you batty!
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform