Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 08:16 PM
koray
Guest
 
Posts: n/a
Default 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?
  #2  
Old July 20th, 2005, 08:16 PM
Lachlan Hunt
Guest
 
Posts: n/a
Default Re: putting commas for large numbers

koray wrote:
[color=blue]
> 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?[/color]

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/
lachlan.hunt@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!
  #3  
Old July 20th, 2005, 08:16 PM
Matt
Guest
 
Posts: n/a
Default Re: putting commas for large numbers

Lachlan Hunt wrote:
[color=blue]
> koray wrote:
>[color=green]
>> 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?[/color]
>
> 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.[/color]

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! =-----
  #4  
Old July 20th, 2005, 08:16 PM
Dr John Stockton
Guest
 
Posts: n/a
Default Re: putting commas for large numbers

JRS: In article <614cddd6.0407042150.38c04f59@posting.google.com >, seen
in news:comp.infosystems.www.authoring.html, koray
<kkoyunpinar@yahoo.com> posted at Sun, 4 Jul 2004 22:50:09 :
[color=blue]
>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?[/color]

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.
  #5  
Old July 20th, 2005, 08:17 PM
Philipp Lenssen
Guest
 
Posts: n/a
Default Re: putting commas for large numbers

koray wrote:
[color=blue]
> 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?[/color]

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

--
Google Blogoscoped
http://blog.outer-court.com
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles