From 36bd906b678c7384c9b1ddc19dc929eef271dc06 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Thu, 16 Jul 2026 17:02:31 +0800 Subject: [PATCH] [gnc-euro.cpp] use GncNumeric.convert() instead of gnc_numeric_convert --- libgnucash/engine/gnc-euro.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libgnucash/engine/gnc-euro.cpp b/libgnucash/engine/gnc-euro.cpp index a46fe41c97..f51ce8ad3f 100644 --- a/libgnucash/engine/gnc-euro.cpp +++ b/libgnucash/engine/gnc-euro.cpp @@ -26,6 +26,7 @@ #include "gnc-euro.h" #include "gnc-session.h" #include +#include /* The rates are per EURO and are denoted in GncNumeric */ static const boost::container::flat_map gnc_euro_rates = @@ -87,7 +88,7 @@ gnc_convert_to_euro(const gnc_commodity * currency, gnc_numeric value) /* EC Regulation 1103/97 states we should use "Round half away from zero" * See https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX%3A31997R1103&qid=1662917247821 */ - return gnc_numeric_convert (value / *euro_rate, 100, GNC_HOW_RND_ROUND_HALF_UP); + return (value / *euro_rate).convert(100); } /* ------------------------------------------------------ */ @@ -101,8 +102,7 @@ gnc_convert_from_euro(const gnc_commodity * currency, gnc_numeric value) /* EC Regulation 1103/97 states we should use "Round half away from zero" * See http://europa.eu/legislation_summaries/economic_and_monetary_affairs/institutional_and_economic_framework/l25025_en.htm */ - return gnc_numeric_convert (value * *euro_rate, gnc_commodity_get_fraction (currency), - GNC_HOW_RND_ROUND_HALF_UP); + return (value * *euro_rate).convert(gnc_commodity_get_fraction (currency)); } /* ------------------------------------------------------ */