wrong dollar sign in the question editor-^-
there is a code for currency formatting in the "JavaScript regular Table Kill Mini Book":
function format (num) {
return num.toFixed(2).replace(/\B(?=(\d{3})+\b)/g, ",").replace(/^/, "$$ ");
};
console.log( format(1888) );
// => "$ 1,888.00"
Why do I use two dollar signs here,
instead of one dollar sign,
and I am also correct to use a dollar sign in Chrome?