Merge pull request #23611 from Naryosha/format

Fix formatting -0.0 by %+f displays +-0.0
This commit is contained in:
Rémi Verschelde 2018-11-09 10:03:16 +01:00 committed by GitHub
commit 1e8cb1ff47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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, "+");
}