Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ROUND()
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00342568
Message ID:
00343374
Views:
32
>>It's NOT a BUG. According to VFP help "SET DECIMAL TO specifies the number of decimal places displayed in numeric expressions". As you can see it doesn't affect calculations.
>I disagree.
>
>The decimal setting is also affecting the result returned by a calculation, not just the display value. Once N has been set with the decimal setting of 1, issuing a SET DECIMAL TO 6 does not affect how VFP displays N. N always displays with 1 decimal place. However, if you use N in a calculation, it uses the expression.
>
>When is X # X? Ans. when you are using VFP and SET DECIMAL TO

No, It doesn't affect result.

Try this
SET DECIMAL TO 1
lnVar1 = 44/7
? lnVar1            && 6.3
SET DECIMAL TO 2
lnVar2 = 44/7
? lnVar2            && 6.29
? lnVar1 = lnVar2  && .T.

DISP MEMO LIKE lnVar*
You can see that both variables have the same internal value 6.28571429
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform