Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRANSFORM() and decimal places
Message
From
01/12/2003 16:59:23
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00853488
Message ID:
00854838
Views:
23
Hi Mike,

I not sure if this will help but try the following:

* make sure a string only contains digits

? chrtran( lcString, chrtran( lcString, "1234567890", "" ), "" ) && returns 2468

* the inner chrtran() evaluates to a string that contains all of the non digit characters
* the outer chrtran() uses that as the mask to remove all of those characters leaving
* only the digits

* Also if you have numeric value in a character field you can use the following:

ROUND(VAL(CHRTRAN(lcPremium,CHRTRAN(lcPremium,"1234567890.",""),"")),2)

By adding the “.” To the list you can retain the decimal point / place in the converted value.

This information was copied and pasted from http://fox.wikis.com/wc.dll?Wiki~StringHandling~VFP

Andy
Previous
Reply
Map
View

Click here to load this message in the networking platform