From 1835dccf8ba0a5620cfad08d3028e05cac58b41e Mon Sep 17 00:00:00 2001 From: suhrke Date: Wed, 12 Jul 2017 20:09:36 -0700 Subject: [PATCH] force floats to fixed width, no scientific notation in output --- ReflexToQ3/includes/EntityConverter.cpp | 4 ++-- ReflexToQ3/includes/brushdef.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ReflexToQ3/includes/EntityConverter.cpp b/ReflexToQ3/includes/EntityConverter.cpp index d93333c..2ae0b92 100644 --- a/ReflexToQ3/includes/EntityConverter.cpp +++ b/ReflexToQ3/includes/EntityConverter.cpp @@ -739,7 +739,7 @@ EntityConverter::offset(const std::string &value, const float amount) const c += amount; std::stringstream ss; - ss << std::fixed << std::setprecision(OUTPUT_PRECISION) << c; + ss << std::fixed << std::fixed << std::setprecision(OUTPUT_PRECISION) << c; return ss.str(); } @@ -754,7 +754,7 @@ EntityConverter::adjustAngleForHandedness(const std::string &angle) const a = -a + 90.0; std::stringstream ss; - ss << std::fixed << std::setprecision(OUTPUT_PRECISION) << a; + ss << std::fixed << std::fixed << std::setprecision(OUTPUT_PRECISION) << a; return ss.str(); } diff --git a/ReflexToQ3/includes/brushdef.cpp b/ReflexToQ3/includes/brushdef.cpp index cdefadc..4d63d4e 100644 --- a/ReflexToQ3/includes/brushdef.cpp +++ b/ReflexToQ3/includes/brushdef.cpp @@ -56,7 +56,7 @@ std::string texdef_net(const TPlanePoints &b) { v3 = -b.vshift / -REFLEX_TEXRES_PLACEHOLDER; // HEIGHT std::stringstream ss; - ss << std::setprecision(MAX_PRECISION) + ss << std::fixed << std::setprecision(MAX_PRECISION) << "( " << h1 << ' ' << h2 << ' ' << h3 << " ) " << "( " << v1 << ' ' << v2 << ' ' << v3 << " )"; return ss.str();