944,156 Members | Top Members by Rank

Ad:
May 7th, 2007
0

display numbers with comma separator in html

Expand Post »
am doing a displaying some data in asp ( data is retreived from the
oracle database)
the data are displaying as the following

income
152000
5200000
8754631

but i just want to display the above with a comma separator
like the following

income
152,000
5,200,000
8,754,631

how i can do this using html or css
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
anitha2324 is offline Offline
11 posts
since Mar 2007
May 7th, 2007
0

Re: display numbers with comma separator in html

Javascript has such a function. It is called:
HTML and CSS Syntax (Toggle Plain Text)
  1. toLocaleString()
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
May 15th, 2007
0

Re: display numbers with comma separator in html

thanks alot for your but is it possible to do it in either html or css .
Reputation Points: 10
Solved Threads: 0
Newbie Poster
anitha2324 is offline Offline
11 posts
since Mar 2007
May 15th, 2007
0

Re: display numbers with comma separator in html

Forget about HTML, HTML is not programming language, if you are using ASP do that in ASP, easy help.
Reputation Points: 9
Solved Threads: 1
Newbie Poster
smalldog is offline Offline
20 posts
since May 2007
May 16th, 2007
0

Re: display numbers with comma separator in html

There is no way to change data in either html or css. They control how things are displayed, but what you want is not a matter of display, but of changing data.

You need to take numerical data, which is stored in the computer in binary form (not decimal), and create a string of characters with decimal numbers in it, separated by commas.

This is far beyond the scope of html and css. In fact, it is not usually provided in most programming languages (The only ones I know of for sure are COBOL, PL-I, and JavaScript). The programmer who wants this kind of display usually has to write a special procedure to create the string.

One thought is that you can somehow use a spreadsheet to do the data conversion. They usually have this capability.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
May 20th, 2007
0

Re: display numbers with comma separator in html

umm, cobol can output those numbers with commas added into them, just move it to a different pic.

What's wrong with calling javascript in this case anyway?
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: CSS stylesheet layout
Next Thread in HTML and CSS Forum Timeline: My PHP Site does not work with IE7





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC