by Robert Hashemian

JavaScript Thousand Separator, Decimal Number Formatter

Cost-free and advertising-free.
Note: This service comes with NO GUARANTEES. No liability is assumed.

What is the JavaScript Thousand Separator, Decimal Number Formatter?

  • A simple JavaScript (DHTML) function for numerical formatting. It formats decimal numbers by inserting separator characters at the thousands positions. For example, 1234512345.12345 becomes 1,234,512,345.12345. You can also specify other separator and decimal point characters to suit your culture.
  • Feel free to download and modify the JavaScript function for your own needs, such as adapting it for your development. If your platform already supports numerical formatting, you should use that instead, as those are generally more robust.
  • For American and British systems, you can skip the second and third parameters. For other cultures, you should specify the separator and decimal point characters to guide the function. The function works fine for whole numbers too.



  • Here's the simple JavaScript Decimal number formatter (copy and paste in your Web page):
    <script language="JavaScript" src=""//www.hashemian.com/js/NumberFormat.js"></script>
    <script language="JavaScript">
    document.write(FormatNumberBy3("1234512345.12345"));
    </script>
    The number is formatted as:

    Here is the version for most of Europe:

    <script language="JavaScript" src=""//www.hashemian.com/js/NumberFormat.js"></script>
    <script language="JavaScript">
    document.write(FormatNumberBy3("1234512345,12345", ",", "."));
    </script>
    The number is formatted as:

    *** From hashemian.com *** see descriptions

    Read Financial Markets  |   Home  |   Blog  |   Web Tools  |   News  |   Articles  |   FAQ  |   About  |   Privacy  |   Contact
    Donate Bitcoin: 1K9TzBvQ2oaEb4tX9t2vKDtZouMcpfV6QF
    paypal.me/rhashemian
    © 2001-2019 Robert Hashemian   Powered by Hashemian.com