Tests:
  • Intl.NumberFormat

    AخA
     
    var a = new Intl.NumberFormat([], {minimumFractionDigits: 2, useGrouping: false}).format(1234567.89);
    var z = Number(a);
  • Manually calculate

    x
     
    const a = 1234567.89;
    const t = Math.pow(10, 2 ?? 0);
    const z = Math.min(
      Math.floor(a * t) /
      t,
      100
    );
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Intl.NumberFormat
    Manually calculate

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Intl.NumberFormat 72855.7 Ops/sec
Manually calculate 6004531.5 Ops/sec