Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js number format space

function numberWithSpaces(x) {
    return x.toString().replace(/B(?=(d{3})+(?!d))/g, " ");
  // 1650000 to 1 650 000
}
 
PREVIOUS NEXT
Tagged: #js #number #format #space
ADD COMMENT
Topic
Name
8+9 =