Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Comma
Message
From
12/05/2005 11:05:05
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
12/05/2005 11:00:41
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01013415
Message ID:
01013421
Views:
10
>Hi, i need some help with this.
>
>i don't know how to do this.
>
>number i got ej."1,260.05"
>i want to convert the "string" to a number
>whenever i do val("1,260.05") but the result is 1.00 not 1,260.05

Eliminate the comma first. strtran() will do the "search and replace" operation (see also chrtran()).
? val(strtran("1,260.05", ",", ""))
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)
Previous
Reply
Map
View

Click here to load this message in the networking platform