Fixed issue #572. Issue with thousand separator during a formula translations

to user.
(grafted from d1621c1cd816e8b7323639ce41c8592ef4131e31)

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-10-04 16:38:54 +03:00
parent 1eb93fd4f7
commit c53b4fb433
2 changed files with 6 additions and 1 deletions

View File

@ -65,6 +65,7 @@
- [#553] Tape.exe crash. Issue with the Search field. - [#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. - [#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. - [#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 # Version 0.4.4 April 12, 2016
- Updated measurement templates with all measurements. Added new template Aldrich/Women measurements. - Updated measurement templates with all measurements. Added new template Aldrich/Women measurements.

View File

@ -939,7 +939,11 @@ QString VTranslateVars::FormulaToUser(const QString &formula, bool osSeparator)
loc = QLocale::system();// To user locale loc = QLocale::system();// To user locale
QString dStr = loc.toString(d);// Number string in 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); newFormula.replace(nKeys.at(i), nValues.at(i).length(), dStr);
const int bias = nValues.at(i).length() - dStr.length(); const int bias = nValues.at(i).length() - dStr.length();
if (bias != 0) if (bias != 0)