473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

trick to populate with decimal

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?

Sep 25 '07 #1
2 1190
"Vinnie" <ce**********@gmail.comwrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
Is it possible?
Yes.
Any suggestion?
i.ToString("0.00");

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

Sep 25 '07 #2
On Sep 25, 10:51 pm, Vinnie <centro.ga...@gmail.comwrote:
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?
for (float i = 1.00F; i <= 100; i=i+.01F) {
....

Sep 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: alex | last post by:
Hi, I am looking for a way to populate an HTML table from an external local text file which looks like this: DATE/TIME LAT. LON. DEPTH. ML....
21
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing/modifying the code. Thank you. .. Facundo
17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
2
by: Carl G | last post by:
I am storing a 0.000 a System.Decimal in a DataRow. On retrieval the value is only 0 without the three decimal places. It looks like the Get property returns System.Decimal.Zero, but why???? I...
2
by: Steve Summit | last post by:
-----BEGIN PGP SIGNED MESSAGE----- It's often explained that the reason for some of the imprecision in C's definition is so that C can be implemented on different kinds of machines -- say, those...
8
by: nick | last post by:
printf("%lf",3.25); the result is 3.25000 i want the answer correct to 3 decimal places What should i do? thanks!
10
by: Paul Sullivan | last post by:
decimal d; d = 1.1M OR d= (decimal) 1.1 Discussioon
0
by: archuleta37 | last post by:
I'm working on reading data from a spreadsheet and outputing it into a datagridview in a windows form (.net 2.0). The problem I've found is that I'm getting 84 rows where only one cell is...
8
by: Gilbert Fine | last post by:
This is a very strange exception raised from somewhere in our program. I have no idea how this happen. And don't know how to reproduce. It just occurs from time to time. Can anyone give me some...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.