Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js number format space

function numberWithSpaces(x) {
    var parts = x.toString().split(".");
    parts[0] = parts[0].replace(/B(?=(d{3})+(?!d))/g, " ");
    return parts.join(".");
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #number #format #space
ADD COMMENT
Topic
Name
8+1 =