From 0f5538e44dd162e63171403ec78b748b09aa1bf2 Mon Sep 17 00:00:00 2001 From: Poommetee Ketson Date: Fri, 9 Nov 2018 15:27:06 +0700 Subject: [PATCH] Fix formatting -0.0 by %+f displays +-0.0 (cherry picked from commit aa311320d92b2982dd4606156882686cc354e551) --- core/ustring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ustring.cpp b/core/ustring.cpp index 43ec465ee12..4f609dd1792 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3929,7 +3929,7 @@ String String::sprintf(const Array &values, bool *error) const { str = str.pad_decimals(min_decimals); // Show sign - if (show_sign && value >= 0) { + if (show_sign && str.left(1) != "-") { str = str.insert(0, "+"); }