Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6318733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:40:35+00:00 2026-05-24T15:40:35+00:00

How can when that typed numbers in input:text, separated them three to three and

  • 0

How can when that typed numbers in input:text, separated them three to three and between them puting this:”,”?
normal number formatting

Example: typed this number in input: 45656839
result (live – online) in same input: 45,656,839
i not want use of plugin.

With respect

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T15:40:37+00:00Added an answer on May 24, 2026 at 3:40 pm

    Demo

    This should do it for you.

    <input type="text" class="numeric" />
    

    $("input:text.numeric").keyup(function(){
        $val = $(this).val();
        $(this).val($val.match(/[0-9]{1,3}/g).join(","))
    });
    

    EDIT

    For normal number formatting, the code is a little different. There’s probably a some good regex out there for this but my first thought was to reverse the string and apply the same technique. Then you reverse the string again and you have it

    $("input:text.numeric").keyup(function(){
        $val = $(this).val().match(/[0-9]/g).reverse().join("").match(/[0-9]{1,3}/g).join(",").match(/./g).reverse().join("");
        $(this).val($val)
    });
    

    EDIT 2

    Demo

    And for future reference if anyone wants to implement this with decimal places (yeah I got carried away :P) …

    $("input:text.numeric").keyup(function(e){
        if(e.which > 40 || e.which == 8) {
            var num = $(this).val().match(/[0-9,]*/g)[0];
            var decimalNum = $(this).val().match(/[.][0-9]*/) || "";
            if(num) {
                var wholeNum = num.match(/[0-9]/g).reverse().join("").match(/[0-9]{1,3}/g).join(",").match(/./g).reverse().join("");
                var resultNum = wholeNum + decimalNum;
                $(this).val(resultNum);
            }
            else
            {
                $(this).val(num);
            }
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Pygame program that needs text input. The way it does this
Using jquery how can I limit the number of characters that can be typed
How can write jquery code that input just accept number. if was something except
I want to have a text box that the user can type in that
HTML: <input type=text name=field id=field value=Select this text http://www.domain.com /> JavaScript/JQuery: $(document).ready(function() { var
Is there a canonical solution for limiting the number of characters that someone can
$(function(){ $(#getitem).click(function(){ var txtval = $(#txt).val(); var number = ????? $('<input type=text name=txt'+number+' value='+txtval+'
I have javascript function that automatically adds input fields together, but adding numbers like
I have a input type number. Once the user enters the number in that
I have a set of html text boxes that take input and when the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.