HTML Preparation code:
x
 
1
2
<script> window.formatter = new Intl.NumberFormat("en-US",{
3
    style: 'decimal',
4
    useGrouping: true,
5
    minimumFractionDigits: 0,
6
    maximumFractionDigits: 20,
7
  });</script>
Tests:
  • Intl.NumberFormat

     
    var a = formatter.format("10000000.1234");
  • toLocalString

     
    var a = "10000000.1234".toLocaleString("en-US",{
        style: 'decimal',
        useGrouping: true,
        minimumFractionDigits: 0,
        maximumFractionDigits: 20,
      });
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Intl.NumberFormat
    toLocalString

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Chrome 97 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Intl.NumberFormat 845591.1 Ops/sec
toLocalString 14903486.0 Ops/sec