Skip to content

Commit

Permalink
benchmark: fix printing of large numbers
Browse files Browse the repository at this point in the history
Don't use Number#toPrecision(), it switches to scientific notation for
numbers with more digits than the precision; use Number#toFixed().

PR-URL: nodejs#185
Reviewed-By: Chris Dickinson <[email protected]>
  • Loading branch information
bnoordhuis committed Dec 20, 2014
1 parent 1a63b45 commit d0c238c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion benchmark/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down

0 comments on commit d0c238c

Please sign in to comment.