Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine precision of certain numeric values
Message
 
À
05/05/2006 12:37:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01119657
Message ID:
01119672
Vues:
21
This message has been marked as the solution to the initial question of the thread.
>Hi,
>
>I am trying to create a cursor filled with the values in the detail band of an FRX file. The values may come form one or more tables or be calculated values. Since this will be done at runtime the environment is exactly the one the report finds and those values will be found with EVAL(Frx.Expr) without regard to where they come from.
>
>When preparing the CREATE CURSOR command I don't know how to determine the precision of numeric values if the Picture field is empty. I'd like the precision to be identical to what shows in the report. I tried using TRANSFORM() and then measuring the length after the decimal point but TRANSFORM(1.50) results in "1.5", not "1.50"
>
>Any suggestions?
>
>TIA,
>
>Alex

One of the solutions:
ln=1.5000
* number of decimals after the dot:
?len(alltr(substr(padr(ln, 20),at(".",padr(ln, 20))+1)))
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform