Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Allt(str(0.00))
Message
De
03/11/2004 11:19:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
03/11/2004 10:47:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00957583
Message ID:
00957641
Vues:
16
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform