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) {
...