By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,868 Members | 1,991 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,868 IT Pros & Developers. It's quick & easy.

putting commas for large numbers

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.