mirror of https://github.com/nodejs/node.git
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
parent
1a63b45a2a
commit
d0c238cc81
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue