473,544 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6497
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**********@la chy.id.au.updat e.virus.scanners

Remove .update.virus.s canners 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.infos ystems.www.authoring.html, koray
<kk*********@ya hoo.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.demo n.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.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
44732
by: David Sharp | last post by:
Once I've converted my floats to chars using STR, is there an easy way to put commas in separating the thousands. i.e. convert 53000000.12 to 53,000,000.12 I'm thinking I'll have to do it with a user defined function and the various string functions myself but was wondering if anyone had an
7
8296
by: AES | last post by:
Encountered a URL containing a comma the other day -- the first time I've ever noticed that, so far as I can recall. It worked fine, however, and I gather commas are legal in URLs. Out of curiosity, did a quick scan of an ASCII file of the 542 URLs in my personal bookmark file and discovered exactly 3 that contained commas (two with a...
10
4968
by: Tuvas | last post by:
I've been thinking about writing a program to generate the world's largest prime numbers, just for the fun of it. This would require being able to hold an 8000000 digit number into memory (25 megabits, or a little over 3 megs of memory for just one variable...) I would also need several smaller variables. This came about as I optimised a prime...
7
1407
by: svm | last post by:
Hi! I'm in the process of creating an invoice-generating program in C#... I've already written the code to produce the page using a PrintDocument, but graphics.DrawString only accepts truetype fonts, so i can't just use spaces (" ") to line up commas... Basically, i would like to do something like this: (In Denmark we use comma as...
3
7623
by: Robert Scheer | last post by:
Hi. I have a regularexpression validator control on a page. This regular expression validates a textbox to accept only numbers and commas: validationexpression="*" I am trying to modify this expression to not allow commas at the beginning and at the end of the expression without success. It needs to allow commas only between the numbers....
14
7056
by: Adrienne Boswell | last post by:
Although this is a client side issue, I am also posting to asp.general in case there is someway to do this only server side (which I would prefer). Here's my form: <form method="post" action="<%=request.servervariables("Script_name") %>" <% for i - 0 to 4%> Header: <input type="text" name="header" id="header<%=i%>"
2
2100
by: freemld10 | last post by:
Hi guys, Can someone please help me to Format Numbers with commas. The script below have very large number without commas. To read numbers in trillions and billions are hard, without commas to separate the numbers. By cutting and pasting the JavaScript below into a web editor and you can clearly see what is happening. Please, help. Thank You,...
11
1904
by: James Kanze | last post by:
On Apr 11, 6:48 am, Jerry Coffin <jerry.cof...@gmail.comwrote: The combination of the two. *IF* it is appropriate to use a container here, that container
0
7424
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7607
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7772
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5909
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5297
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4918
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3409
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1841
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
661
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.