refs #77, used locale aware number parsing for command parser

This commit is contained in:
Klaus Basan
2014-11-17 01:47:48 +01:00
committed by Roland Winklmeier
parent c173a30a94
commit eb13c9d4ae
3 changed files with 32 additions and 20 deletions

View File

@@ -8,6 +8,9 @@
*/
#include "simplecommandparser.h"
#include "pqstring.h"
using namespace BlackMisc::PhysicalQuantities;
namespace BlackMisc
{
@@ -78,7 +81,7 @@ namespace BlackMisc
const QString p = this->part(index);
if (p.isEmpty()) return false;
bool ok;
p.toDouble(&ok);
CPqString::parseNumber(p, ok, CPqString::SeparatorsBestGuess);
return ok;
}
@@ -96,7 +99,7 @@ namespace BlackMisc
const QString p = this->part(index);
if (p.isEmpty()) return def;
bool ok;
double d = p.toDouble(&ok);
double d = CPqString::parseNumber(p, ok, CPqString::SeparatorsBestGuess);
return ok ? d : def;
}