473,382 Members | 1,635 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,382 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 1411
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dan Sommers | last post by:
Hi, I have a class whose objects represent physical quantities including uncertainties and units, and I would like more control over the way they print. I have a __str__ method which outputs...
4
by: Tommi Mäkitalo | last post by:
Hi I need to format floating-point-numbers with exact 2 digits after decimal point. I could use printf with "%.2f", but it don't use std::locale. Any ideas? -- Tommi Mäkitalo
4
by: Dave Brydon | last post by:
Access 2003 I have a combo box in my personnel table, which draws its data from a trade code table; the original field in the code table, is numeric, Long Integer, and formatted with 5 zero's . ...
4
by: John Sutor | last post by:
I need some code that, on each keyup event, will take all of the numbers typed into the text box and format as they type to look like this 100 1,000 10,000 100,000 1,000,000 John S
7
by: ilona | last post by:
Hi all, I store phone numbers in the database as 123447775665554(input mask is used for input, and some numbers have extensions), and I also know from db if the number is Canadian, US, or some...
9
by: Markus | last post by:
Hi all, two questions on formatting numbers: - Given is a decimal/money datatype in SQL-Server, e.g. decimal(9,4), thus displaying a value like 13.2000 How can I prevent to display the...
5
by: Carla | last post by:
I have Access 2000. I made a mailing list database and for the life of me can't remember how to format the zip code field so it will print on the label as xxxxx-xxxx. I have tried various - 9, #,...
6
by: Rafael Olarte | last post by:
The goal of this project is to output the following information as follows: 34.5 38.6 4.1 42.4 3.8 close 46.8 4.4 big change. The values of the first colunm are obtain from a file...
2
by: jerryyang_la1 | last post by:
I need some advice on formatting numbers using PHP. My database holds numbers like: 10 0.2 I need these to be displayed as 10.00
3
by: sparks | last post by:
We have one database that they are constantly reformatting their inputs. I asked about the changes and they can never get the same types of numbers from the people. some are -.95 and later they...
1
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: 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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.