summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/util/units.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/units.cpp b/src/util/units.cpp
index 7bc910fcc..3fdd77916 100644
--- a/src/util/units.cpp
+++ b/src/util/units.cpp
@@ -227,9 +227,10 @@ Quantity UnitTable::getQuantity(Glib::ustring const& q) const
// Extract value
double value = 0;
- Glib::RefPtr<Glib::Regex> value_regex = Glib::Regex::create("[-+]*[\\d+]*\\.*[\\d+]*[eE]*[-+]*\\d+");
+ Glib::RefPtr<Glib::Regex> value_regex = Glib::Regex::create("[-+]*[\\d+]*[\\.,]*[\\d+]*[eE]*[-+]*\\d+");
if (value_regex->match(q, match_info)) {
- value = atof(match_info.fetch(0).c_str());
+ std::istringstream tmp_v(match_info.fetch(0));
+ tmp_v >> value;
}
// Extract unit abbreviation