Answers for "how to number format with $ js"

16

javascript format number

(12345.67).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');  // 12,345.67
Posted by: Guest on February-23-2020
3

js number format

function numberWithSpaces(x) {
    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
}
Posted by: Guest on October-08-2021
0

javascript number format

var x = parseFloat('9.656');

x.toFixed(0);           // returns 10
x.toFixed(2);           // returns 9.66
x.toFixed(4);           // returns 9.6560
x.toFixed(6);
Posted by: Guest on June-23-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language