Use ICU number/plural formatting

This commit is contained in:
Jamie Kyle
2023-04-03 12:03:00 -07:00
committed by GitHub
parent aba8882d0a
commit da24cc5e95
30 changed files with 254 additions and 222 deletions

View File

@@ -28,7 +28,7 @@ export const getMaximumAttachmentSizeInKb = (
};
export function getRenderDetailsForLimit(limitKb: number): {
limit: string;
limit: number;
units: string;
} {
const units = ['kB', 'MB', 'GB'];
@@ -40,7 +40,7 @@ export function getRenderDetailsForLimit(limitKb: number): {
} while (limit >= KIBIBYTE && u < units.length - 1);
return {
limit: limit.toFixed(0),
limit: Math.trunc(limit),
units: units[u],
};
}