mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 16:56:11 +00:00
Fix issues with formatLargeNumber
This commit is contained in:
parent
06ec265bcd
commit
f505c7f5fd
@ -192,7 +192,9 @@ export function formatLargeNumber(count: integer, threshold: integer): string {
|
|||||||
return '?';
|
return '?';
|
||||||
}
|
}
|
||||||
const digits = ((ret.length + 2) % 3) + 1;
|
const digits = ((ret.length + 2) % 3) + 1;
|
||||||
const decimalNumber = parseInt(ret.slice(digits, digits + (3 - digits)));
|
let decimalNumber = ret.slice(digits, digits + 2);
|
||||||
|
while (decimalNumber.endsWith('0'))
|
||||||
|
decimalNumber = decimalNumber.slice(0, -1);
|
||||||
return `${ret.slice(0, digits)}${decimalNumber ? `.${decimalNumber}` : ''}${suffix}`;
|
return `${ret.slice(0, digits)}${decimalNumber ? `.${decimalNumber}` : ''}${suffix}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user