blob: 9cb16a088fe30299b3accf769e5819241da02c51 [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
Skyler Grey75ea9172022-08-06 10:22:23 +01007export default addPlural;