Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Posts
    91

    JS help: Adding commas to numbers

    I'm using the following JS code for a timer:

    Code:
    jQuery(function($) {
            $('.timer').countTo({
                from: 2046430,
                to: 2048503,
                speed: 3050000,
                refreshInterval: 50,
                onComplete: function(value) {
                    console.debug(this);
                }
            });
        });
    How do I add commas to "2046430" so it looks like "2,046,430"?

    Thanks for the help!

  2. #2
    Join Date
    May 2009
    Location
    Markham, Canada
    Posts
    440
    Dan
    Check out our premium self-managed SSD VPS

Similar Threads

  1. PHP strip some commas - but not all!
    By monkeypigs in forum Programming Discussion
    Replies: 7
    Last Post: 05-13-2012, 06:01 AM
  2. Javascript Adding weighted numbers
    By mjfroggy in forum Programming Discussion
    Replies: 3
    Last Post: 11-18-2011, 02:29 PM
  3. PHP inserting commas into a string
    By netfreak in forum Programming Discussion
    Replies: 2
    Last Post: 10-06-2007, 07:13 AM
  4. Escaping commas for a CSV file
    By Ralisten in forum Programming Discussion
    Replies: 5
    Last Post: 03-07-2005, 02:45 AM
  5. Stop CPanel from adding Cpanel login when adding user
    By AlexNY in forum Hosting Software and Control Panels
    Replies: 2
    Last Post: 05-25-2004, 03:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •