javascript tousand seperator
function formatNumber(num) {
return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,')
}
console.info(formatNumber(2665)) // 2,665
console.info(formatNumber(102665)) // 102,665
console.info(formatNumber(111102665)) // 111,102,665
Also in JavaScript:
- Appending the option element using jquery each function
- unix timestamp to date javascript yyyy-mm-dd
- access to xmlhttprequest at angular 8
- how to make pages from list in nodejs
- how to get name array value checked in jquery
- js format date dd/mm/yyyy
- javascript format rupiah
- adonis andwhere
- HashLocationStrategy
- curl pass raw json in post request
- react native webview postmessage example
- select jquery display none
- pluton
- prepend javascript
- remove second last element from array javascript
- jquery open page in new tab
- javascript map value nested object
- javascript enumerate
- Rectangle class module
- switch i javascript
- latest rn fatch blob package download
- jquery delete buton
- how to write a program that alerts the first 3 letters of the current day in javascript
- purecomponent re rendering