akubera / bigdecimal-rs

Arbitrary precision decimal crate for Rust
Other
302 stars 73 forks source link

Fix incorrect handling of _ in decimal #99

Closed DanielBauman88 closed 1 year ago

DanielBauman88 commented 1 year ago

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

https://github.com/akubera/bigdecimal-rs/issues/100

akubera commented 1 year ago

Thank you.