Skip to content

Commit 0ba37a7

Browse files
committed
better formatting
1 parent 4a05874 commit 0ba37a7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

dev-packages/node-overhead-gh-action/lib/Formatter.mjs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,20 @@ export class Formatter {
2525
}
2626

2727
formatResult(name, base, current, baseline) {
28+
const numFormat = new Intl.NumberFormat('en-US', {
29+
style: 'decimal',
30+
minimumFractionDigits: 0,
31+
maximumFractionDigits: 0,
32+
});
33+
34+
const currentValue = current ? numFormat(current) : '-';
35+
const baseValue = base ? numFormat(base) : '-';
36+
2837
return [
2938
name,
30-
current || '-',
39+
currentValue,
3140
baseline != null ? this.formatPercentageChange(baseline, current) : '-',
32-
base || '-',
41+
baseValue,
3342
this.formatPercentageChange(base, current),
3443
];
3544
}

0 commit comments

Comments
 (0)