fix: use Math.round in formatInteger letter suffix to avoid floating-point truncation
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m1s
CI / Lint, Build & Test (pull_request) Successful in 1m11s

This commit is contained in:
2026-04-06 16:27:02 -07:00
committed by Naomi Carrigan
parent 85a3c65d28
commit e9e5678a0a
+1 -1
View File
@@ -127,7 +127,7 @@ const formatInteger = (value: number): string => {
const steps = stepsAboveBase * 3;
const divisorExp = letterBaseExp + steps;
const divisor = Math.pow(10, divisorExp);
return `${String(Math.floor(value / divisor))}${getLetterSuffix(stepsAboveBase)}`;
return `${String(Math.round(value / divisor))}${getLetterSuffix(stepsAboveBase)}`;
}
for (const { threshold, suffix } of namedSuffixes) {
if (value >= threshold) {