Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Numeric to string
Message
De
10/11/2007 09:29:26
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
09/11/2007 21:08:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01267854
Message ID:
01268204
Vues:
14
>nvar1=130.30
>?CHRTRAN(STR(nvar1,6,2),SET("POINT"),"-")
>
>But the value of nvar1 may different as
>130.30
>1235.20
>15487.10
>
>Then how to set point?

Read the help for Set Point and Set Decimal - they are quite different. Also, try

?set("point")
?set("decimals")

and see what you get on your machine. Whenever a set(...) function is mentioned, it means that you have to allow for a setting different from yours. Specifically, some cultures have a decimal point and comma for thousands separator, some have a decimal comma and point for thousands separator. Martina's solution will work regardless of how it was set.

In case I got you wrong, if your problem is the possible length of the string...

?alltrim(CHRTRAN(STR(nvar1,16,2),SET("POINT"),"-"))

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform