thaerali
asked on
number format in asp.net
i have data showen in a coulmn in table which contains this value in this format
1500
11560
115601
1212342
11342342
445654355
4456543550
4456543550.12
99300888222
99300888222.001
how can i show this value in this format
1,500.000
11,560.000
115,601.000
1,212,342.000
11,342,342.000
445,654,355.000
4,456,543,550.000
4,456,543,550.012
99,300,888,222.000
99,300,888,222.001
i need this format by asp.net ,can any one help me please ??
best regards
1500
11560
115601
1212342
11342342
445654355
4456543550
4456543550.12
99300888222
99300888222.001
how can i show this value in this format
1,500.000
11,560.000
115,601.000
1,212,342.000
11,342,342.000
445,654,355.000
4,456,543,550.000
4,456,543,550.012
99,300,888,222.000
99,300,888,222.001
i need this format by asp.net ,can any one help me please ??
best regards
If the number is in intMyNumber then
intMyNumber.ToString("#,## #.##")
will do it
intMyNumber.ToString("#,##
will do it
Sorry, that should have been
intMyNumber.ToString("#,## #.000")
intMyNumber.ToString("#,##
My version would be
Response.Write(String.Form at("{0:#,# #0.000;(#, ##0.000);N othing}", 12345670.55));
Response.Write(String.Form
I got this expression from orbulat's post. Just trying to give you a version without the £ character
Andrew
Andrew
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I understand what you are saying REA_ANDREW but ultimately our code will be maintained by others. Sometimes those 'others' will not be a skilled as us and as used to reading regular expressions as us. It is our job to do things in as clear and as simple way as possible for this reason. One should only ramp up the complexity if it is absolutley warrented by the problem being addressed.
Point taken, Good comment and I totally agree!
:-)
Andrew
:-)
Andrew
Hi thaerali
Is my suggestion helped you?
Is my suggestion helped you?
u may try string.format