Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TRANSFORM() depends on SET DECIMAL. Bug?
Message
De
21/07/2004 12:24:58
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
21/07/2004 12:12:51
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00926580
Message ID:
00926611
Vues:
20
>You may want to enhance it so that it shows, for example, "0,3" instead of ",3".

Here is an improved version, that adds the zero at the beginning:


function MyTransform(tnNumber)
* Solve problems with transform() function
local lcReturnValue
lcReturnValue = strtran(alltrim(strtran(str(tnNumber, 20, 10), "0", " ")), " ", "0")
if left(lcReturnValue, 1) = set("point")
lcReturnValue = "0" + lcReturnValue
endif
return lcReturnValue
endfunc
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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform