Skip to content

Commit

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

Expand All @@ -134,7 +134,7 @@ impl<T: BaseCurrency> CurrencyAmount<T> {
Ok(
(self.as_fraction() / Fraction::new(self.decimal_scale.clone(), 1)).to_fixed(
decimal_places,
Some(rounding.unwrap_or(Rounding::RoundDown)),
Some(rounding.unwrap_or_default()),
),
)
}
Expand Down

0 comments on commit 4e3b9ae

Please sign in to comment.