Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
malik672 committed Nov 9, 2024
1 parent b1178a9 commit 4c4539f
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/entities/fractions/currency_amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,8 @@ impl<T: BaseCurrency> CurrencyAmount<T> {
significant_digits: u8,
rounding: Option<Rounding>,
) -> Result<String, Error> {
(self.as_fraction() / Fraction::new(self.decimal_scale.clone(), 1)).to_significant(
significant_digits,
Some(rounding.unwrap_or_default()),
)
(self.as_fraction() / Fraction::new(self.decimal_scale.clone(), 1))
.to_significant(significant_digits, Some(rounding.unwrap_or_default()))
}

/// Convert the currency amount to a string with a fixed number of decimal places
Expand All @@ -132,10 +130,8 @@ impl<T: BaseCurrency> CurrencyAmount<T> {
return Err(Error::Invalid("DECIMALS"));
}
Ok(
(self.as_fraction() / Fraction::new(self.decimal_scale.clone(), 1)).to_fixed(
decimal_places,
Some(rounding.unwrap_or_default()),
),
(self.as_fraction() / Fraction::new(self.decimal_scale.clone(), 1))
.to_fixed(decimal_places, Some(rounding.unwrap_or_default())),
)
}

Expand Down

0 comments on commit 4c4539f

Please sign in to comment.