Fixed broken formula when for system locale thousand separator is a space.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2016-02-29 14:17:49 +02:00
parent ce88024313
commit 7cb84f9931
2 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,5 @@
# Version 0.4.3 # Version 0.4.3
- Fixed broken formula when for system locale thousand separator is a space.
- Using QGraphicsScene instead of VMainGraphicsScene caused a crash. - Using QGraphicsScene instead of VMainGraphicsScene caused a crash.
- Fixed bug disabling tool True darts. - Fixed bug disabling tool True darts.
- Fixed wrong calculation tool True darts. - Fixed wrong calculation tool True darts.

View File

@ -889,7 +889,8 @@ QString VTranslateVars::FormulaToUser(const QString &formula) const
} }
loc = QLocale::system();// To user locale loc = QLocale::system();// To user locale
const 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
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)