Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TRANSFORM() and decimal places
Message
De
01/12/2003 16:59:23
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00853488
Message ID:
00854838
Vues:
24
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform