From 363516049d449d21c98f161705894192e858a112 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Fri, 14 Sep 2018 18:37:04 +0300 Subject: [PATCH] Actually fix General number formatting --- components/interpreter/miscopcodes.hpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/components/interpreter/miscopcodes.hpp b/components/interpreter/miscopcodes.hpp index 03b7e186f5..77e5a00790 100644 --- a/components/interpreter/miscopcodes.hpp +++ b/components/interpreter/miscopcodes.hpp @@ -65,23 +65,18 @@ namespace Interpreter } else if (notation == ShortestNotation) { - std::string scientific; - std::string fixed; - - out << std::scientific << value; - - scientific = out.str(); + out << value; + std::string standard = out.str(); out.str(std::string()); out.clear(); - out << std::fixed << value; - - fixed = out.str(); + out << std::scientific << value; + std::string scientific = out.str(); - mFormattedMessage += fixed.length() < scientific.length() ? fixed : scientific; + mFormattedMessage += standard.length() < scientific.length() ? standard : scientific; } - else + else { out << std::scientific << value; mFormattedMessage += out.str();