Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / July 2007

Tip: Looking for answers? Try searching our database.

Format Percetage

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Samuel - 02 Jul 2007 16:49 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
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.