vcl/source/control/longcurr.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
New commits: commit d330dccca8d5ec8619aaaca626afabb04ab58679 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Jan 7 20:56:37 2025 +0000 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Wed Jan 8 13:44:50 2025 +0100 Resolves: tdf#158669 round long currency to decimal digits in use as its predecessor did before: commit 0c85d1ee0688435ffefd8eff797e57eac9bace27 CommitDate: Wed Jul 15 10:26:16 2020 +0200 weld LongCurrencyControl Change-Id: I251c976b9b3025a0faddd0f75cd303c29b1a33c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179918 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 4d996634ee43aeb84925d1cc7553b07ac94a5ceb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179936 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx index 587c99cf1724..96afc509dfa2 100644 --- a/vcl/source/control/longcurr.cxx +++ b/vcl/source/control/longcurr.cxx @@ -221,7 +221,13 @@ namespace weld { const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper(); const OUString& rCurrencySymbol = !m_aCurrencySymbol.isEmpty() ? m_aCurrencySymbol : rLocaleDataWrapper.getCurrSymbol(); - double fValue = GetValue() * weld::SpinButton::Power10(GetDecimalDigits()); + double fValue = GetValue(); + sal_uInt16 nDecimalDigits = GetDecimalDigits(); + if (nDecimalDigits) + { + // tdf#158669 round to decimal digits + fValue = std::round(fValue * weld::SpinButton::Power10(nDecimalDigits)); + } OUString aText = ImplGetCurr(rLocaleDataWrapper, fValue, GetDecimalDigits(), rCurrencySymbol, m_bThousandSep); ImplSetTextImpl(aText, nullptr); return true;