You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let a = Decimal::new(100, 2);
let b = Decimal::new(300, 2);
let c = a / b;
println!("{}", c);
println!("{:.2}", c);
produces the output:
0.3333333333333333333333333333
0.
This is because the implementation converts to a string first and applies the pad method. Decimal should implement further format instructions to support producing 2dp without requiring rounding first up.
The text was updated successfully, but these errors were encountered:
The following code:
produces the output:
This is because the implementation converts to a string first and applies the
pad
method. Decimal should implement further format instructions to support producing 2dp without requiring rounding first up.The text was updated successfully, but these errors were encountered: