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 / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

trick to populate with decimal

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vinnie - 25 Sep 2007 21:51 GMT
When i try populate a dropdownlist menu using a for cycle  i get a
list of integers from ( in example ) 1 to 10. How can populate the
same list, if working on the code (C#) i wish to get not longer a
series of integers, but a series of decimals?

Like this:
old list: (for i=1; i<=100; i++) i get 100 integers;

New list) i want to populate the same list, but using the decimals:
1.00; 1.01; 1.02; 1.03.... 99.99, 100.00

Is it possible?

Any suggestion?
Mark Rae [MVP] - 25 Sep 2007 21:58 GMT
> Is it possible?

Yes.

> Any suggestion?

i.ToString("0.00");

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Alexey Smirnov - 25 Sep 2007 22:01 GMT
> When i try populate a dropdownlist menu using a for cycle  i get a
> list of integers from ( in example ) 1 to 10. How can populate the
[quoted text clipped - 10 lines]
>
> Any suggestion?

for (float i = 1.00F; i <= 100; i=i+.01F) {
...

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.