mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
uucore/format: remove TODOs related to bigdecimal
This commit is contained in:
parent
636e4a777b
commit
60ebace7f2
1 changed files with 1 additions and 11 deletions
|
@ -246,14 +246,8 @@ impl Formatter<&ExtendedBigDecimal> for Float {
|
|||
*/
|
||||
let (abs, negative) = match e {
|
||||
ExtendedBigDecimal::BigDecimal(bd) => {
|
||||
// Workaround printing bug in BigDecimal, force 0 to scale 0.
|
||||
// TODO: Remove after https://github.com/akubera/bigdecimal-rs/issues/144 is fixed.
|
||||
if bd.is_zero() {
|
||||
(ExtendedBigDecimal::zero(), false)
|
||||
} else {
|
||||
(ExtendedBigDecimal::BigDecimal(bd.abs()), bd.is_negative())
|
||||
}
|
||||
}
|
||||
ExtendedBigDecimal::MinusZero => (ExtendedBigDecimal::zero(), true),
|
||||
ExtendedBigDecimal::Infinity => (ExtendedBigDecimal::Infinity, false),
|
||||
ExtendedBigDecimal::MinusInfinity => (ExtendedBigDecimal::Infinity, true),
|
||||
|
@ -730,12 +724,8 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "Need https://github.com/akubera/bigdecimal-rs/issues/144 to be fixed"]
|
||||
fn decimal_float_zero() {
|
||||
use super::format_float_decimal;
|
||||
// We've had issues with "0e10"/"0e-10" formatting.
|
||||
// TODO: Enable after https://github.com/akubera/bigdecimal-rs/issues/144 is fixed,
|
||||
// as our workaround is in .fmt.
|
||||
let f = |digits, scale| {
|
||||
format_float_decimal(&BigDecimal::from_bigint(digits, scale), 6, ForceDecimal::No)
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue