Skip to content

Commit

Permalink
Update primitives/src/math/fixed.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Chralt <[email protected]>
  • Loading branch information
maltekliemann and Chralt98 authored Sep 28, 2023
1 parent f4f4427 commit 7b796ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion primitives/src/math/fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ impl<F: Fixed + ToString, N: TryFrom<u128>> FromFixedToDecimal<F> for N {
let mut increment = false;

let new_frac_part = if frac_part.len() < decimals_usize {
format!("{}{}", frac_part, "0".repeat(decimals_usize - frac_part.len()))
format!("{}{}", frac_part, "0".repeat(decimals_usize.saturating_sub(frac_part.len())))
} else {
// Adding rounding behavior
let round_digit = frac_part.chars().nth(decimals_usize);
Expand Down

0 comments on commit 7b796ee

Please sign in to comment.