Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Round() Bug
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00459503
Message ID:
00459541
Views:
24
>Why the arbitrary length of 20? The article suggests the workaround of changing it to a string and back to numeric, so how about just
ROUND( VAL( TRANSFORM(tnNumber)), tnDecimals)


?transform(tnnumber)
tnnumber=2.0000000056984984924892482948294829
?transform(tnnumber)
tnnumber=2.00000000569
tnnumber=0.00000000569
?transform(tnnumber)
tnnumber=0.02000000569
?transform(tnnumber)
?val(transform(tnnumber))

The maximum number of decimals, BTW, is 12, as I just found.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform