Use integers and not numbers in notification policy API counters (#29810)

This commit is contained in:
Renaud Chaput authored and GitHub committed 2024-04-02 10:06:26 +00:00
1 parent d05f62391d
commit b4d991adaa
4 files changed
+11 -11

No files matched your search

+4 -4
View File
@@ -70,10 +70,10 @@ export function roundTo10(num: number): number {
return Math.round(num * 0.1) / 0.1;
}
export function toCappedNumber(num: string): string {
if (parseInt(num) > 99) {
return '99+';
export function toCappedNumber(num: number, max = 99): string {
if (num > max) {
return `${max}+`;
} else {
return num;
return num.toString();
}
}