Skip to content

Commit 4e58ec4

Browse files
targosdanielleadams
authored andcommitted
benchmark: output JSON-compatible numbers
This is to simplify the implementation of a JavaScript version of the compare.R script. PR-URL: #38778 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
1 parent 6d86f8a commit 4e58ec4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

benchmark/common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class Benchmark {
267267
function nanoSecondsToString(bigint) {
268268
const str = bigint.toString();
269269
const decimalPointIndex = str.length - 9;
270-
if (decimalPointIndex < 0) {
270+
if (decimalPointIndex <= 0) {
271271
return `0.${'0'.repeat(-decimalPointIndex)}${str}`;
272272
}
273273
return `${str.slice(0, decimalPointIndex)}.${str.slice(decimalPointIndex)}`;

0 commit comments

Comments
 (0)