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
 
Back
Top