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

  • SEARCH
  • Home
  • 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 7896407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:53:15+00:00 2026-06-03T07:53:15+00:00

In asp.net project, I want to group digits while typing in a textbox. Example:

  • 0

In asp.net project,
I want to group digits while typing in a textbox.
Example:
123456123456
123.456.123.456

My aim is not grouping ip adress. I want it to read numbers easily. eg : 12.000.152.156.123.156

How can i do this?

  • 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-06-03T07:53:17+00:00Added an answer on June 3, 2026 at 7:53 am

    Edit: If you instead want to do that on serverside(don’t tag javascript, people have spent a lot of time to provide you a clientside solution):

    double number = 123456123456;
    String numeric = String.Format("{0:#,0}", number); // "123.456.123.456"
    

    http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx


    added by balexandre

    and you can always add some simple validation

    using System.Net;
    
    IPAddress ip = new System.Net.IPAddress(); 
    if(IPAddress.TryParse(numeric, out ip))
        // you get a valid IP Address in the ip variable
    else
        // IP Address not valid, go back and ask again...
    

    If you want to add a thousand separator to a numeric string value you can use this function:

    <script type="text/javascript">
        function groupDigit(strDigit, separator) {
            if (separator == null || separator.length == 0) separator = ".";
            strDigit += '';
            x = strDigit.split('.');
            x1 = x[0];
            x2 = x.length > 1 ? '.' + x[1] : '';
            var rgx = /(\d+)(\d{3})/;
            while (rgx.test(x1)) {
                x1 = x1.replace(rgx, '$1' + separator + '$2');
            }
            return x1 + x2;
        }
    </script>
    

    test:

    alert(groupDigit("123456123456", ".")); // 123.456.123.456
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using MySql in my asp.net project. But I don't want to type every
I'm working on an ASP.NET project for a school. In one area I want
I'm looking to create a fairly large-scale ASP.NET MVC project and I want to
I want to override a string from a System.ComponentModel.DataAnnotations for an ASP.NET project. Do
I happen to have an ASP.NET 2.0 project that I want to apply a
The Scenario I have an ASP.NET web project. I want to be able to
i need to have one project on asp.net mvc 1 but i want to
I started my project in Asp.net MVC(c#) & SQL Server 2005.I want to implement
My project is developed on ASP.net with C#. I want to publish my project
I want to debug my silverlight project in IE and debug other ASP.Net projects

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.