Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
math vs to fixed
(version: 0)
Comparing performance of:
Math vs toFixed
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var x = 34234.23434423
Tests:
Math
Math.round((x + Number.EPSILON) * 1000) / 1000
toFixed
(x + Number.EPSILON).toFixed(1).toString()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Math
toFixed
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser/OS:
Chrome 130 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Math
3775336.2 Ops/sec
toFixed
3075841.2 Ops/sec
Related benchmarks:
toFixed vs Math.round() - result as a number
toFixed vs Math.round()
toFixed vs Math.round() 2
toFixed vs Math.round
Math.round()
toFixed vs Round
round to multiple of
toFixed vs round with epsilon
toFixed vs Math.round() with numbers
Benchmark math.round *100/100 vs toFixed(2)
Comments
Confirm delete:
Do you really want to delete benchmark?