summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-11-09 10:03:16 +0100
committerGitHub <noreply@github.com>2018-11-09 10:03:16 +0100
commit1e8cb1ff474ea266b9962cb4055f6e10a37bc41e (patch)
treec40808bf28921aa8367c01a4758c096baac83594
parentef54537b00a2473efd2f3ce1c9f8d426f983a50d (diff)
parentaa311320d92b2982dd4606156882686cc354e551 (diff)
Merge pull request #23611 from Naryosha/format
Fix formatting -0.0 by %+f displays +-0.0
-rw-r--r--core/ustring.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 2191bb5e23..3f017fa985 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -4035,7 +4035,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, "+");
}