From c53b4fb433217eca7f5c3ff57b30611ccf784a17 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 4 Oct 2016 16:38:54 +0300 Subject: [PATCH] Fixed issue #572. Issue with thousand separator during a formula translations to user. (grafted from d1621c1cd816e8b7323639ce41c8592ef4131e31) --HG-- branch : develop --- ChangeLog.txt | 1 + src/libs/vpatterndb/vtranslatevars.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 19b8a74e6..b47e21610 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -65,6 +65,7 @@ - [#553] Tape.exe crash. Issue with the Search field. - [#569] Tape app. Options that open new file open new instance even if a user doesn't want this. - [#539] Infinite alert loop "Gradation doesn't support inches" when loading standard table. +- [#572] Issue with thousand separator during a formula translations to user. # Version 0.4.4 April 12, 2016 - Updated measurement templates with all measurements. Added new template Aldrich/Women measurements. diff --git a/src/libs/vpatterndb/vtranslatevars.cpp b/src/libs/vpatterndb/vtranslatevars.cpp index 6f7ce3429..51dca3fe9 100644 --- a/src/libs/vpatterndb/vtranslatevars.cpp +++ b/src/libs/vpatterndb/vtranslatevars.cpp @@ -939,7 +939,11 @@ QString VTranslateVars::FormulaToUser(const QString &formula, bool osSeparator) loc = QLocale::system();// To user locale QString dStr = loc.toString(d);// Number string in user locale - dStr.replace(" ", ""); // Remove thousand separator + const QChar thSep = loc.groupSeparator(); + if (thSep.isSpace()) + { + dStr.remove(thSep);// Remove thousand separator + } newFormula.replace(nKeys.at(i), nValues.at(i).length(), dStr); const int bias = nValues.at(i).length() - dStr.length(); if (bias != 0)