Answers for "format number javascript with comma''''"

5

javascript friendly number format with commas

//ES6 Way
const numberWithCommas = (x) => {
  return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}
Posted by: Guest on July-23-2020
6

format number javascript with comma

formatedNumber = new Intl.NumberFormat().format(2561556862056.12)
console.log(formatedNumber) // "2,561,556,862,056.12"
Posted by: Guest on October-03-2021
-1

how to format an integer with a comma in javascript

x.toString().toLocaleString(); // x must be a number
Posted by: Guest on July-15-2020

Code answers related to "format number javascript with comma''''"

Code answers related to "Javascript"

Browse Popular Code Answers by Language