Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Showing percentage sign in variable
Message
From
15/08/2005 10:52:13
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01040979
Message ID:
01040998
Views:
13
Hi Neil

If you just want to display a numeric valu as a percent value, on your form, then you can have the form field text box with a percent sign label next to it.

If the value is stored AS a percentage (e.g. 90% stored as 0.9) then you can either have the form field bound to a form property whose value is (cmscomp.percent * 100) ...

or LTRIM( STR( cmscomp.percent * 100, 5, 2)) + "%" (in this case you can dispense with the "%" label on the form)

Otherwise (if value stored as, say, 90) you display the value as-is (i.e. either of the above 2 but without the "* 100" bit.

Would that this helps.

Terry

>I would like to append the % sign to a variable. My syntax reads:
>
>
>store cmscomp.percent+val("%") to lccomplist
>
>
>But this comes out like 90.00 instead of reading 90.0%
>
>How can I achieve this?
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Reply
Map
View

Click here to load this message in the networking platform