From 8e4bc5d598cd59994731f3f8cadd980e9cdad6c7 Mon Sep 17 00:00:00 2001 From: don bright Date: Wed, 1 Aug 2012 18:43:39 -0500 Subject: change value so that ECHO works more like old Qstring.sprintf diff --git a/src/value.cc b/src/value.cc index 666062a..3b7f357 100644 --- a/src/value.cc +++ b/src/value.cc @@ -198,7 +198,12 @@ public: } return tmpstr; #else - return boost::lexical_cast(op1); + // attempt to emulate Qt's QString.sprintf("%g"); from old OpenSCAD. + // see https://github.com/openscad/openscad/issues/158 + std::stringstream tmp; + tmp.unsetf(std::ios::floatfield); + tmp << op1; + return tmp.str(); #endif } -- cgit v0.10.1