diff options
author | Michaƫl Zasso <targos@protonmail.com> | 2021-05-23 12:28:18 +0300 |
---|---|---|
committer | Danielle Adams <adamzdanielle@gmail.com> | 2021-05-31 22:34:54 +0300 |
commit | 4e58ec4aa657feeb937c557df7c1dcec760d36b4 (patch) | |
tree | 789490f2031eec29971135692f727b132c696e3c /benchmark | |
parent | 6d86f8afd5026e72e63d99c9334064b86092163d (diff) |
benchmark: output JSON-compatible numbers
This is to simplify the implementation of a JavaScript version of the
compare.R script.
PR-URL: https://github.com/nodejs/node/pull/38778
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/common.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/benchmark/common.js b/benchmark/common.js index 3f7abf73632..28a317b9a1d 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -267,7 +267,7 @@ class Benchmark { function nanoSecondsToString(bigint) { const str = bigint.toString(); const decimalPointIndex = str.length - 9; - if (decimalPointIndex < 0) { + if (decimalPointIndex <= 0) { return `0.${'0'.repeat(-decimalPointIndex)}${str}`; } return `${str.slice(0, decimalPointIndex)}.${str.slice(decimalPointIndex)}`; |