Closed Ballasi closed 2 years ago
Something I would like to add for the English language before moving on to other languages is the ability to set preferences.
For instance, here is a sample code:
use num2words::*; fn print_game_score(home_score: i64, away_score: i64) -> Result<(), Num2Err> { println!( "{} - {}", Num2Words::new(home_score).to_words()?, Num2Words::new(away_score).to_words()? ); Ok(()) }
Calling print_game_score(3, 0).unwrap() would print three - zero, but in this case, we are more likely to be interested to see three - nil, same for "oh" (e.g., in versioning).
print_game_score(3, 0).unwrap()
three - zero
three - nil
I am interested in implementing a call similar to the one below:
Num2Words::new(home_score).prefer(["nil"]).to_words()
Something I would like to add for the English language before moving on to other languages is the ability to set preferences.
For instance, here is a sample code:
Calling
print_game_score(3, 0).unwrap()
would printthree - zero
, but in this case, we are more likely to be interested to seethree - nil
, same for "oh" (e.g., in versioning).I am interested in implementing a call similar to the one below: