Separate each three numbers with a comma in Javascript, and separate the js amount with three commas.

Source: Internet
Author: User
Tags arabic numbers

Separate each three numbers with a comma in Javascript, and separate the js amount with three commas.

Frequently Used in work:
Example 1: change the number 1111111 to 11,111,111.00 and retain two decimal places.

<Html> 

Example 2: Convert the number 1111111 to 11,111,111 --- and change 11,111,111 to 1111111 --- integer --

<! Doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> 

The above is all the content of this article. I hope it will be helpful for your learning and easy to format JavaScript amount numbers. Thank you for reading.

Articles you may be interested in:
  • Thousands of numbers separated by Javascript
  • JS converts numbers into three-character comma-separated styles (sample code)
  • Sample Code for converting JavaScript values to three-digit comma-separated values
  • Separate each three digits of Arabic numbers with a comma (for example, 15000000 is converted to 15,000,000) in JavaScript)
  • Add a thousands separator to a number using a Javascript Regular Expression

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.