-
Notifications
You must be signed in to change notification settings - Fork 75
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
Incorrect handling of "_" chars in decimal part of number #100
Comments
Proposed fix: #99 |
DanielBauman88
added a commit
to DanielBauman88/bigdecimal-rs
that referenced
this issue
May 10, 2023
BigDecimal supports '_' chars as visual seperators in number strings in the pre and post "." parts of the number. The counting of post "." digits however counts all characters but it should exclude '_' chars. The underscore support comes from BigDecimal's use of num-bigint https://github.com/rust-num/num-bigint/blob/6f2b8e0fc218dbd0f49bebb8db2d1a771fe6bafa/src/biguint/convert.rs#L246 akubera#100
akubera
pushed a commit
that referenced
this issue
May 12, 2023
BigDecimal supports '_' chars as visual seperators in number strings in the pre and post "." parts of the number. The counting of post "." digits however counts all characters but it should exclude '_' chars. The underscore support comes from BigDecimal's use of num-bigint https://github.com/rust-num/num-bigint/blob/6f2b8e0fc218dbd0f49bebb8db2d1a771fe6bafa/src/biguint/convert.rs#L246 #100
akubera
pushed a commit
that referenced
this issue
May 12, 2023
BigDecimal supports '_' chars as visual seperators in number strings in the pre and post "." parts of the number. The counting of post "." digits however counts all characters but it should exclude '_' chars. The underscore support comes from BigDecimal's use of num-bigint https://github.com/rust-num/num-bigint/blob/6f2b8e0fc218dbd0f49bebb8db2d1a771fe6bafa/src/biguint/convert.rs#L246 #100
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To see this run
println!("{}", BigDecimal::from_str("1_1.2_2").unwrap().to_string());
and you will see1.122
as the output.The text was updated successfully, but these errors were encountered: