Browse Source

benchmark: fix printing of large numbers

Don't use Number#toPrecision(), it switches to scientific notation for
numbers with more digits than the precision; use Number#toFixed().

PR-URL: https://github.com/iojs/io.js/pull/185
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
archived-io.js-v0.12
Ben Noordhuis 10 years ago
parent
commit
d0c238cc81
  1. 2
      benchmark/common.js

2
benchmark/common.js

@ -187,7 +187,7 @@ Benchmark.prototype.end = function(operations) {
Benchmark.prototype.report = function(value) {
var heading = this.getHeading();
if (!silent)
console.log('%s: %s', heading, value.toPrecision(5));
console.log('%s: %s', heading, value.toFixed(0));
process.exit(0);
};

Loading…
Cancel
Save