Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Decimal length!
Message
De
06/10/2005 18:58:08
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01056998
Message ID:
01057004
Vues:
21
This message has been marked as the solution to the initial question of the thread.
>Hi Everybody,
>
>How do I determine the decimal length of a numeric expression? For example for 678.76548 it is five.
>
>Thank you,
>Ali

transform() is not very trustworthy, and results vary with different VFP versions, but you can convert to text with padr() or padl():
? alltrim(padr(678.76548, 30))
From the result, you can search for the position of the point, or, safer, of the expression set("point") (in L.A. we use a comma; the situation is similar in most of Europe). Use the at() function.
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