From 4e3b9ae6b8532a39dcb6970d0527ef637e2916be Mon Sep 17 00:00:00 2001 From: malik Date: Sat, 9 Nov 2024 12:11:32 +0100 Subject: [PATCH] fix rounding --- src/entities/fractions/currency_amount.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entities/fractions/currency_amount.rs b/src/entities/fractions/currency_amount.rs index 995942f..15b1e85 100644 --- a/src/entities/fractions/currency_amount.rs +++ b/src/entities/fractions/currency_amount.rs @@ -117,7 +117,7 @@ impl CurrencyAmount { ) -> Result { (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()), ) } @@ -134,7 +134,7 @@ impl CurrencyAmount { 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()), ), ) }