Intl.NumberFormat
David Walsh
APRIL 12, 2021
format(12345) // 12,345 new Intl.NumberFormat('en-US', { maximumSignificantDigits: 4}).format(1.2345678) format(1.2345678) // 1.235 (Notice the rounding) new Intl.NumberFormat('en-GB', { style: 'currency', currency: 'GBP' }).format(9002.20) Let’s check it out! format(9002.20) // £9,002.20
Let's personalize your content