MCPcopy Create free account
hub / github.com/coinbase/cb-mpc / floatStr

Function floatStr

vendors/github-action-benchmark/src/write.ts:133–147  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

131}
132
133function floatStr(n: number) {
134 if (!Number.isFinite(n)) {
135 return `${n > 0 ? '+' : '-'}∞`;
136 }
137
138 if (Number.isInteger(n)) {
139 return n.toFixed(0);
140 }
141
142 if (n > 0.1) {
143 return n.toFixed(2);
144 }
145
146 return n.toString();
147}
148
149function strVal(b: BenchmarkResult): string {
150 let s = `\`${b.value}\` ${b.unit}`;

Callers 3

buildCommentFunction · 0.85
buildAlertCommentFunction · 0.85
handleAlertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected