Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRANFORM() Behavior ... changed from SP1 ???
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00616533
Message ID:
00616620
Views:
26
>>>I have this common lines:
>>>
>>>CREATE CURSOR test(Num NUMERIC(10,2))
>>>APPEND BLANK
>>>REPLACE Num WITH 10.2
>>>
>>>
>>>In VFP 6.0 if i issue this command:
>>>? TRAN(Num) i have this result 10.2
>>>
>>>In VFP 7.0 SP1, witnh the same command i have this result 10.20 .... i supect that this behavior is changed from SP1 ... anyone can confirm this supect ? .. and is a Feauture or is an Introduced Bug ??
>>>
>>>Emanuele
>>
>>I can confirm that transform() function bechavior changed in VFP 7. Contrary to what help says it doesn't strip trailing zeros from the decimal portion anymore. I think it's a bug.
>
>I think this is by design. Try
? TRANSFORM(10.2) && Displays 10.2
>? TRANSFORM(10.20) && Displays 10.20
>SET DECIMALS TO 1
>? TRANSFORM(10.20) && Displays 10.20
It's not by design because it doesn't work this way in VFP 6. Try in VFP 6.
? TRANSFORM(10.2) && Displays 10.2
? TRANSFORM(10.20) && Displays 10.2
SET DECIMALS TO 1
? TRANSFORM(10.20) && Displays 10.2
The VFP 6/7 help also states that "Trailing zeros are removed from the decimal portion of a numeric value".
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform