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>
pull/185/head
Ben Noordhuis 2014-12-20 00:03:10 +01:00
parent 1a63b45a2a
commit d0c238cc81
1 changed files with 1 additions and 1 deletions

View File

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