display numbers with comma separator in html

Reply

Join Date: Mar 2007
Posts: 11
Reputation: anitha2324 is an unknown quantity at this point 
Solved Threads: 0
anitha2324 anitha2324 is offline Offline
Newbie Poster

display numbers with comma separator in html

 
0
  #1
May 7th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: display numbers with comma separator in html

 
0
  #2
May 7th, 2007
Javascript has such a function. It is called:
HTML and CSS Syntax (Toggle Plain Text)
  1. toLocaleString()
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 11
Reputation: anitha2324 is an unknown quantity at this point 
Solved Threads: 0
anitha2324 anitha2324 is offline Offline
Newbie Poster

Re: display numbers with comma separator in html

 
0
  #3
May 15th, 2007
thanks alot for your but is it possible to do it in either html or css .
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 20
Reputation: smalldog is an unknown quantity at this point 
Solved Threads: 1
smalldog smalldog is offline Offline
Newbie Poster

Re: display numbers with comma separator in html

 
0
  #4
May 15th, 2007
Forget about HTML, HTML is not programming language, if you are using ASP do that in ASP, easy help.
Join a forum for webmasters and developers
HTML Forum
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: display numbers with comma separator in html

 
0
  #5
May 16th, 2007
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.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 802
Reputation: Phaelax is on a distinguished road 
Solved Threads: 40
Phaelax Phaelax is offline Offline
Practically a Posting Shark

Re: display numbers with comma separator in html

 
0
  #6
May 20th, 2007
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?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum


Views: 5026 | Replies: 5
Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC