diff --git a/src/libslic3r/PlaceholderParser.cpp b/src/libslic3r/PlaceholderParser.cpp index 42caa999e0..ae66178aa3 100644 --- a/src/libslic3r/PlaceholderParser.cpp +++ b/src/libslic3r/PlaceholderParser.cpp @@ -270,9 +270,22 @@ namespace client { std::string out; switch (type) { - case TYPE_BOOL: out = std::to_string(data.b); break; + case TYPE_BOOL: out = data.b ? "true" : "false"; break; case TYPE_INT: out = std::to_string(data.i); break; - case TYPE_DOUBLE: out = std::to_string(data.d); break; + case TYPE_DOUBLE: +#if 0 + // The default converter produces trailing zeros after the decimal point. + out = std::to_string(data.d); +#else + // ostringstream default converter produces no trailing zeros after the decimal point. + // It seems to be doing what the old boost::to_string() did. + { + std::ostringstream ss; + ss << data.d; + out = ss.str(); + } +#endif + break; case TYPE_STRING: out = *data.s; break; default: break; }