blob: 619ced2dc7c84f30ba5db66a4c6e482bbba33fbe [file] [log] [blame]
pineafan63fc5e22022-08-04 22:04:10 +01001function addPlural(amount: number | string, unit: string) {
pineafan73a7c4a2022-07-24 10:38:04 +01002 amount = amount.toString();
pineafan63fc5e22022-08-04 22:04:10 +01003 if (amount === "1") return `${amount} ${unit}`;
4 return `${amount} ${unit}s`;
pineafane625d782022-05-09 18:04:32 +01005}
6
7export default addPlural;