From e64e3a9044973340ae6538448e9430744682d671 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 5 Feb 2015 13:56:51 +0200 Subject: [PATCH] Wrong conversion expression if number has 0 in fractional part. Example 10,0. Such numbers ignored and left untouched. This cause error in calculation. --HG-- branch : develop --- src/app/core/vapplication.cpp | 51 ++++++++++++++++------------------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 6d47aa27f..c23c427c4 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -1771,27 +1771,25 @@ QString VApplication::FormulaFromUser(const QString &formula) QList nValues = numbers.values(); for (int i = 0; i < nKeys.size(); ++i) { + loc = QLocale::system(); bool ok = false; - qreal d = loc.toDouble(nValues.at(i), &ok); + const qreal d = loc.toDouble(nValues.at(i), &ok); if (ok == false) { qDebug()<<"Can't convert to double token"< nValues = numbers.values(); for (int i = 0; i < nKeys.size(); ++i) { - QLocale loc = QLocale(QLocale::C); + loc = QLocale(QLocale::C); bool ok = false; - qreal d = loc.toDouble(nValues.at(i), &ok); + const qreal d = loc.toDouble(nValues.at(i), &ok); if (ok == false) { qDebug()<<"Can't convert to double token"<