diff options
Diffstat (limited to 'src/libslic3r/PlaceholderParser.cpp')
-rw-r--r-- | src/libslic3r/PlaceholderParser.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/libslic3r/PlaceholderParser.cpp b/src/libslic3r/PlaceholderParser.cpp index eae8f418b..ae66178aa 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 = boost::to_string(data.b); break; - case TYPE_INT: out = boost::to_string(data.i); break; - case TYPE_DOUBLE: out = boost::to_string(data.d); break; + case TYPE_BOOL: out = data.b ? "true" : "false"; break; + case TYPE_INT: out = std::to_string(data.i); 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; } |