toFixed then cast

Benchmark created on


Setup

const values = Array.from({length: 100}, (_, i) => Math.random() * 100)

Test runner

Ready to run.

Testing in
TestOps/sec
cast
values.map(v => ((v * 100)|0)/100)
ready
toFixed
values.map(v => +v.toFixed(2) ) 
ready

Revisions

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