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
Patrice - 02 Jul 2007 17:06 GMT
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...
---
Patrice
> 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
DOsborn - 02 Jul 2007 17:09 GMT
> 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