472,119 Members | 1,595 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

putting commas for large numbers

hi,
i need to show large numbers seperated by commas. since i'm using
variables from speedscript, i cannot know their values, since the user
should enter them. how should i code to show these large numbers in
comma(or pointed)-style?
Jul 20 '05 #1
4 6264
koray wrote:
hi,
i need to show large numbers seperated by commas. since i'm using
variables from speedscript, i cannot know their values, since the user
should enter them. how should i code to show these large numbers in
comma(or pointed)-style?


This coding cannot be done directly with HTML. You need to use
either server side or client side scripting in order to format the
numbers. I recommend server side, unless your willing to accept that
for users with javascript disabled or unsupported, the numbers will
degrade to being unformatted. Either way, this is not the correct
newsgroup to ask in. Please ask in a newsgroup for server side or
client side scripting — whichever is appropriate for your needs and
choice of language.

--
Lachlan Hunt
http://www.lachy.id.au/
la**********@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!
Jul 20 '05 #2
Lachlan Hunt wrote:
koray wrote:
hi,
i need to show large numbers seperated by commas. since i'm using
variables from speedscript, i cannot know their values, since the user
should enter them. how should i code to show these large numbers in
comma(or pointed)-style?


This coding cannot be done directly with HTML. You need to use
either server side or client side scripting in order to format the
numbers. I recommend server side, unless your willing to accept that
for users with javascript disabled or unsupported, the numbers will
degrade to being unformatted. Either way, this is not the correct
newsgroup to ask in. Please ask in a newsgroup for server side or
client side scripting — whichever is appropriate for your needs and
choice of language.


Note also that different countries use different seperators:

For 1234567 and 98 thousandths:

1,234,567·098
1,234,567.098
1.234.567,098

The first is used in the UK (but usually we're lazy and use . instead of
·) and probably lots of other places, the second in the US and elsewhere,
the third in much of Europe (and probably elsewhere too). To avoid
confusion, you might be better off using no-break spaces:

1 234 567.098
1 234 567,098
1 234 567·098

--
Matt
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #3
JRS: In article <61**************************@posting.google.com >, seen
in news:comp.infosystems.www.authoring.html, koray
<kk*********@yahoo.com> posted at Sun, 4 Jul 2004 22:50:09 :
i need to show large numbers seperated by commas. since i'm using
variables from speedscript, i cannot know their values, since the user
should enter them. how should i code to show these large numbers in
comma(or pointed)-style?


Your shift key is disused, broken or missing; please remedy that.

What's speedscript?

See <URL:http://www.merlyn.demon.co.uk/js-maths.htm#Out>.

Are there any places that use a more-or-less European script (including
Cyrillic) that normally use something other than dot or comma for the
decimal separator, and something other than dot, comma, [thin] space, or
none for the thousands separator?

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> JL / RC : FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 20 '05 #4
koray wrote:
i need to show large numbers seperated by commas. since i'm using
variables from speedscript, i cannot know their values, since the user
should enter them. how should i code to show these large numbers in
comma(or pointed)-style?


I use PHP on the server-side for this task. The function is called
"number_format".

--
Google Blogoscoped
http://blog.outer-court.com
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by David Sharp | last post: by
7 posts views Thread by AES | last post: by
10 posts views Thread by Tuvas | last post: by
7 posts views Thread by svm | last post: by
3 posts views Thread by Robert Scheer | last post: by
14 posts views Thread by Adrienne Boswell | last post: by
11 posts views Thread by James Kanze | last post: by
reply views Thread by leo001 | last post: by

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.