Answers for "how to format number as currency string in javascript"

16

how to format numbers as currency string js

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

javascript format number as currency

const formatter = new Intl.NumberFormat('en-US', {
  style: 'currency',
  currency: 'USD',
  minimumFractionDigits: 2
})

formatter.format(1000) // "$1,000.00"
formatter.format(10) // "$10.00"
formatter.format(123233000) // "$123,233,000.00"
Posted by: Guest on June-02-2021

Code answers related to "how to format number as currency string in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language