Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug in currency data type? Someone Explain this one.
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00394894
Message ID:
00395061
Views:
11
>Ken,
>
>No Bug here,

JimB,

My bad! I forgot that the currency data type automatically rounds to 4 decimal places. Additionally, the data type returned from a mathematical operation on a currency data type will be currency (forgot that too!).

Anyway, FWIW, here's the how to replicate the bug as shown in the MS KB article. And, yes, it's in SP4.
mrate = 86.173125
mhours = 24.0000
mpay = mhours * mrate
? mpay && 2068.1550000000
test = STR(mpay, LEN(STR(mpay)), LEN(STR(mpay)))
? ROUND(mpay, 2) && 2068.15???
? ROUND(VAL(test), 2) && 2068.16

George

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

Click here to load this message in the networking platform