pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 1 | function addPlural(amount: any, unit: string) { |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame^] | 2 | amount = amount.toString(); |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 3 | if (amount === '1') return `${amount} ${unit}` |
4 | return `${amount} ${unit}s` | ||||
5 | } | ||||
6 | |||||
7 | export default addPlural; |