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.
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?
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?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.