Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert numeric to char
Message
From
27/04/2002 19:26:45
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00649247
Message ID:
00650088
Views:
19
>>>>
>>>>transform() should work, but it doesn't always give the desired results. For instance, transform(-80.9) gives -80,90000000000001 on my computer (VFP 6, SP5).
>>>>
>>>>You may be better of writing your own function for this purpose.
>>>>
>>>
>>>In VFP7 it correctly returns -80.9.
>>
>>I am aware of the fact that the problem has been partly corrected. But I also heard that it sometimes adds an - unneeded - zero at the end.
>>
>It doesn't add zeros but it doesn't strip them either. So ? TRANSFORM(1.1000) returns 1.1000 instead of 1.1

That's what I don't like. Anyway, it seems to me that depending on your specific needs, you might be better of creating a UDF (or using a more complicated expression), to strip superfluous zeroes.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform