NumberExpression: Added std::setprecision to keep precision of number in double to string conversion.

This commit is contained in:
Eivind Kvedalen
2015-12-11 01:58:24 +01:00
committed by wmayer
parent af9d9be117
commit d012bdba3a

View File

@@ -258,7 +258,7 @@ void NumberExpression::negate()
std::string NumberExpression::toString() const
{
std::stringstream s;
s << quantity.getValue();
s << std::setprecision(std::numeric_limits<double>::digits10 + 1) << quantity.getValue();
/* Trim of any extra spaces */
//while (s.size() > 0 && s[s.size() - 1] == ' ')