Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Num2Words::parse with input that matches "0[1-9]" produces "duodecillion" #23

Closed
80Ltrumpet opened this issue Mar 7, 2024 · 1 comment · Fixed by #24
Closed

Num2Words::parse with input that matches "0[1-9]" produces "duodecillion" #23

80Ltrumpet opened this issue Mar 7, 2024 · 1 comment · Fixed by #24

Comments

@80Ltrumpet
Copy link
Contributor

Minimal Reproducer

use num2words::Num2Words;

fn main() {
    let zero_one = Num2Words::parse("01").unwrap().to_words().unwrap();
    println!("{zero_one}");
}

Expected Output

one

Note: zero one is a valid alternative, but 010 yields ten, not zero ten.

Actual Output

one duodecillion

Commentary

This behavior holds for all inputs matching the pattern: 0[1-9] (exactly two digits where the first digit is zero and the second digit is not zero).

@80Ltrumpet
Copy link
Contributor Author

The underlying cause is in the num-bigfloat crate.

80Ltrumpet added a commit to 80Ltrumpet/num2words that referenced this issue Mar 9, 2024
Ballasi pushed a commit that referenced this issue Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant