Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to convert numeric value to percentage?

Status
Not open for further replies.

ereeksd

Vendor
Nov 21, 2011
5
PH
Can you please help me on what command is needed to convert a numeric value to percentage? thank you! :)
 
A percentage is a numeric value. It's just referencing towards some other value being 100%, so it depends what kind of value you have. The "conversion" could simply be multiplying by 100, if you have a relative quantity between 0 and 1, but it might be totally different, if you have an absolute value you'd first need to scale by whatever 100% is.


Bye, Olaf.
 
@OLAFDOSCHKE
Thanks for the info, one more question, can i use the STR(command) to convert automatically to a percentage?
 
No, STR() converts numeric to string, this has nothing to do with percentage.

Bye, Olaf.
 
@Mike
Thanks I got it already. Thanks for the help anyway

@olaf
I got it. thanks for the help.
 
Good you figured it out. You just keep me wondering what you wanted. Just printing a % sign after the percentage value? Did you think about a percentage variable type, which would print a % sign similar to the currency type printing a currency symbol?

Such a thing does not exist.

Bye, Olaf.
 
Yes, i thought there was a command that was able to convert a whole number into a percent when it was commanded to be run. Thanks anyway!
 
I don't know any programming language having a special command for that. Also, by your specification of convertig a whole number to percent, as an example: What would 64789226 be, converted to a percentage?

Bye, Olaf.
 
I thought there was a command that was able to convert a whole number into a percent when it was commanded to be run.

You might want to spend some time studying the various VFP Commands and Functions that are available to use.

The VFP Help 'system' has a complete list of Commands and Functions.

Good Luck,
JRB-Bldr
 
Check out the TRANSFORM() function. It's handy for reformatting values to meet various criteria.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top