#numbers #word #decline

decline-word

Choose word form based on given number

3 releases

0.1.2 Jul 14, 2023
0.1.1 Jul 14, 2023
0.1.0 Jul 13, 2023

#1875 in Text processing

MIT/Apache

3KB

decline word

1. Add dependency:

cargo add decline-word

2. Use:

let value = decline_for_num(12412, &("минута", "минуты", "минут"));
println!("{value}");

let value = decline_for_num(387222, &("рубль", "рубля", "рублей"));
println!("{value}");

Output:

минут
рубля

No runtime deps