Format Percetage

  • Thread starter Thread starter Samuel
  • Start date Start date
S

Samuel

Why when using the FormatPercentage method I get a figure which is 100 times
what in the database and what is the common approach to resolve that?

Thanks,
Sam
 
This is because this formatting option assumes that 50 % means 50/100 that
is 0.5 (and not 50 as you could thought).

So do your own formatting (by just appending the % sign) or scale down your
values in the 0,1 range instead of the 0,100 range...
 
Why when using the FormatPercentage method I get a figure which is 100 times
what in the database and what is the common approach to resolve that?

Thanks,
Sam

FormatPercentage is expecting a decimal (as in .50 instead of 50%) and
multiples by 100 to get a proper percent. If you just want to format
it try using String.Format.

David
http://blog.ctrlalt313373.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top