472,143 Members | 1,443 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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 1370
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 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.