Rounding methods in JavaScript

Benchmark created by Pawel Grzybek on


Test runner

Ready to run.

Testing in
TestOps/sec
Math.round(3.14159 * 100) / 100
Math.round(3.14159 * 100) / 100
ready
parseFloat(3.14159.toFixed(2))
parseFloat(3.14159.toFixed(2))
ready

Revisions

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

  • Revision 1: published by Pawel Grzybek on