From 9c5c34b0c8f4d1651e3cfe9ca227e55ccbd6ccfe Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 12 Dec 2021 16:23:58 +0100 Subject: [PATCH] Leave away unnecessary trailing zeros in script numeric values for menus --- .../Parsing/Menu/Sequence/EventHandlerSetScopeSequences.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ObjLoading/Parsing/Menu/Sequence/EventHandlerSetScopeSequences.cpp b/src/ObjLoading/Parsing/Menu/Sequence/EventHandlerSetScopeSequences.cpp index 29cb29dc..18ed112b 100644 --- a/src/ObjLoading/Parsing/Menu/Sequence/EventHandlerSetScopeSequences.cpp +++ b/src/ObjLoading/Parsing/Menu/Sequence/EventHandlerSetScopeSequences.cpp @@ -41,7 +41,11 @@ namespace menu if (firstToken.m_type == SimpleParserValueType::INTEGER) return SimpleParserValue::String(firstToken.GetPos(), new std::string(std::to_string(firstToken.IntegerValue()))); if (firstToken.m_type == SimpleParserValueType::FLOATING_POINT) - return SimpleParserValue::String(firstToken.GetPos(), new std::string(std::to_string(firstToken.FloatingPointValue()))); + { + std::ostringstream ss; + ss << std::noshowpoint << firstToken.FloatingPointValue(); + return SimpleParserValue::String(firstToken.GetPos(), new std::string(ss.str())); + } return SimpleParserValue::String(firstToken.GetPos(), new std::string(firstToken.StringValue())); }) });