Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine precision of certain numeric values
Message
From
05/05/2006 15:10:31
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01119657
Message ID:
01119742
Views:
15
>>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)))

Brilliant! Thank you.

Alex
Previous
Reply
Map
View

Click here to load this message in the networking platform