Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript friendly number format with commas

//ES6 Way
const numberWithCommas = (x) => {
  return x.toString().replace(/B(?=(d{3})+(?!d))/g, ',');
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #friendly #number #format #commas
ADD COMMENT
Topic
Name
9+9 =