Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rounding problem?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00348122
Message ID:
00348516
Views:
32
>>
>>Try:
>>
>>round( a * b * c, 2 )=round( 0.3500000000 * 943 * .100, 2 )
>>
>>You'll get false. There's some sort of problem connected with the number of decimal places.
>
>You correct (naturally!)
>maybe the fact that one has leading spaces and the other does not hat something to do with it
>try ?val(trans( 0.3500000000 * 943 * .100))==val(trans(a*b*c))
>it returns true

I know. Go and read my previous posts on this thread. It appears that it has something to do with the number of decimal places involved in the constants. I've speculated that (for some reason) the interal data type can't correctly process it. In fact, try this:
? TRANSFORM(.35000000 * 943.0 * .100, '###.############')
? TRANSFORM(.35000000 * 943.0 * .100, '###.###########')
and see what you get.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform