Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert numeric to char
Message
De
25/04/2002 19:19:28
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00649247
Message ID:
00649423
Vues:
21
>If I had a numeric value of 1.4476, how can I convert this to character and make it look exactly like numeric value ("1.4476"). whenever I do following I get just 1 character rounded up or down:
>
>ct = 1.4476
>x = str(ct)
>?x &&shows "1"
>
>I need it to show "1.4476"
>
>thanks
>Nick Patel

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.

HTH, 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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform