954,135 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

display numbers with comma separator in html

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

anitha2324
Newbie Poster
11 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

Javascript has such a function. It is called:

toLocaleString()
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

thanks alot for your but is it possible to do it in either html or css .

anitha2324
Newbie Poster
11 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

Forget about HTML, HTML is not programming language, if you are using ASP do that in ASP, easy help.

smalldog
Newbie Poster
20 posts since May 2007
Reputation Points: 9
Solved Threads: 1
 

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.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

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?

Phaelax
Practically a Posting Shark
858 posts since Mar 2004
Reputation Points: 92
Solved Threads: 51
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You