Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numeric to string
Message
From
10/11/2007 09:29:26
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
09/11/2007 21:08:09
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01267854
Message ID:
01268204
Views:
13
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform