User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 456,196 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,924 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 2577 | Replies: 5
Reply
Join Date: Mar 2007
Posts: 11
Reputation: anitha2324 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
anitha2324 anitha2324 is offline Offline
Newbie Poster

display numbers with comma separator in html

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 2,604
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 119
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: display numbers with comma separator in html

  #2  
May 7th, 2007
Javascript has such a function. It is called:
toLocaleString()
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Mar 2007
Posts: 11
Reputation: anitha2324 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
anitha2324 anitha2324 is offline Offline
Newbie Poster

Re: display numbers with comma separator in html

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

Re: display numbers with comma separator in html

  #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  
Join Date: Jan 2007
Posts: 2,604
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 119
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: display numbers with comma separator in html

  #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  
Join Date: Mar 2004
Posts: 732
Reputation: Phaelax is on a distinguished road 
Rep Power: 6
Solved Threads: 31
Phaelax Phaelax is offline Offline
Master Poster

Re: display numbers with comma separator in html

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb HTML and CSS Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 3:49 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC