From e3793e6c88be174bc16cd32c311ed02b59092c81 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 19 Feb 2019 13:46:22 +0100 Subject: [PATCH] use format options when using repr() on a quantity --- src/Base/QuantityPyImp.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Base/QuantityPyImp.cpp b/src/Base/QuantityPyImp.cpp index 508d566e58..7ddef4089a 100644 --- a/src/Base/QuantityPyImp.cpp +++ b/src/Base/QuantityPyImp.cpp @@ -36,6 +36,8 @@ using namespace Base; std::string QuantityPy::representation(void) const { std::stringstream ret; + ret.precision(getQuantityPtr()->getFormat().precision); + ret.setf(std::ios::fixed, std::ios::floatfield); ret << getQuantityPtr()->getValue() << " "; ret << getQuantityPtr()->getUnit().getString().toUtf8().constData();