Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Allt(str(0.00))
Message
From
03/11/2004 11:19:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
03/11/2004 10:47:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00957583
Message ID:
00957641
Views:
15
>Help please
>
i=allt(str(1.52))
>messagebox(i)
>I get 2.
>How can I get 1.52 in the messagebox?

Sergey gave you an answer that should work; now let me explain what is going on.

str() uses three parameters. The second is the size, and the third is the number of decimals. If you omit the third parameter, the default is zero decimals.

padr() or padl() can adjust the number of decimals automatically, depending on contents. So can transform() (with only one parameter), but irregular behaviour has been observed in some cases. This varies depending on the VFP version.
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