pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 1 | function addPlural(amount: number | string, unit: string) { |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 2 | amount = amount.toString(); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 3 | if (amount === "1") return `${amount} ${unit}`; |
4 | return `${amount} ${unit}s`; | ||||
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 5 | } |
6 | |||||
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame^] | 7 | export default addPlural; |