CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Inserting commas into lengthy NUMBERS

 



benn600
User


May 11, 2005, 7:21 PM

Post #1 of 2 (418 views)
Inserting commas into lengthy NUMBERS Can't Post

How can I automatically enter commas into a long number (as simply as possible)? So for 1000 -- it would yield 1,000 etc.

Thank you!
----------------------------------------------------------------------------
Wink http://www.ppcpathways.com/ Wink
Visit my new site devoted to reviewing the latest pocketpc products and news that I built in cgi-perl!


davorg
Thaumaturge / Moderator

May 12, 2005, 6:34 AM

Post #2 of 2 (402 views)
Re: [benn600] Inserting commas into lengthy NUMBERS [In reply to] Can't Post

It's well worth getting to know how to use the free documentation that comes with Perl. It's all accessible with the command "perldoc". So typing "perldoc perldoc" at your command line will give you documentation on how to use perldoc.

One particularly useful part of the Perl documentation is the list of Frequently Asked Questions (or FAQ). Everyone programming in Perl should read through that section at least once. However, if you're too busy for that, then perldoc has a useful command line parameter (-q) which searches the FAQ for questions containing a given word in the question.

So if you had typed "perldoc -q comma" on your command line you would have got the answers to "Can I write useful Perl programs on the command line?" (which is't useful at this point) and "How can I output my numbers with commas added?" (which is).

Using the documentation that is installed with Perl for queries like this is generally far quicker than asking a question on a forum like this and waiting a day or two for a reply.

It's also worth noting that the full Perl documentation set is also available online

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives