浏览代码

Fix formatting -0.0 by %+f displays +-0.0

Poommetee Ketson 7 年之前
父节点
当前提交
aa311320d9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/ustring.cpp

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