JS String to number conversion

Benchmark created on


Preparation HTML

<script>
  var $dec = 4;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Mult
$dec.toFixed(2) * 1
ready
Div
$dec.toFixed(2) / 1
ready
Sub
$dec.toFixed(2) - 1
ready
Unary
+$dec.toFixed(2)
ready
Number constructor
Number($dec.toFixed(2))
ready

Revisions

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