mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 00:08:46 +00:00
[Glitch] Use integers and not numbers in notification policy API counters
Port b4d991adaa to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user