Instantiating Intl.NumberFormat (v2)

Revision 2 of this benchmark created on


Setup

const formatter = new Intl.NumberFormat('en-us', {
    style: 'currency',
    currency: 'GBP'
})

Test runner

Ready to run.

Testing in
TestOps/sec
Instantiate
new Intl.NumberFormat('en-us', { style: 'currency', currency: 'GBP' }).format(1000)
ready
Cache
formatter.format(1000)
ready
toLocaleString
Number(1000).toLocaleString('en-us', { style: 'currency', currency: 'GBP' })
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.