469,646 Members | 1,616 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,646 developers. It's quick & easy.

Formatting Numbers

I have some questions about Numberformatting
What is the best way to format a number that will be shown to a user? is it

CultureInfo cultureInfo = CultureInfo.CurrentCulture
int.Parse(summaryObjectArray[0].ToString()).ToString("N",cultureInfo)
how can i assign less/more decimal digits to a number

i have 1'000'000.00 //standard format i think..

I want 1'000'000 //would be nice for an int that is getting converted..

thanks for your hel
Plunaldo
Nov 18 '05 #1
1 1326
Hi, Plunaldo,

Have a look at the whole section:
http://msdn.microsoft.com/library/en...matstrings.asp

For your example:

int a = 1000000;
Response.Write(a.ToString("N0"));

should produce:

1'000'000

if the thousands separator for the current culture is '

Hope this helps
Martin
"Plunaldo" <an*******@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
I have some questions about Numberformatting:
What is the best way to format a number that will be shown to a user? is it:
CultureInfo cultureInfo = CultureInfo.CurrentCulture;
int.Parse(summaryObjectArray[0].ToString()).ToString("N",cultureInfo);
?

how can i assign less/more decimal digits to a number?

i have 1'000'000.00 //standard format i think...

I want 1'000'000 //would be nice for an int that is getting converted...

thanks for your help
Plunaldo

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Tommi Mäkitalo | last post: by
4 posts views Thread by John Sutor | last post: by
7 posts views Thread by ilona | last post: by
9 posts views Thread by Markus | last post: by
5 posts views Thread by Carla | last post: by
2 posts views Thread by jerryyang_la1 | last post: by
3 posts views Thread by sparks | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.