Enable grisu for general format

This commit is contained in:
Victor Zverovich
2019-03-17 09:48:50 -07:00
parent c21c6b8c4b
commit 76d326a2a2
4 changed files with 18 additions and 14 deletions
+1 -1
View File
@@ -645,7 +645,7 @@ FMT_FUNC bool grisu2_format(Double value, buffer& buf, int precision,
bool fixed, int& exp) {
FMT_ASSERT(value >= 0, "value is negative");
if (value <= 0) { // <= instead of == to silence a warning.
if (precision < 0) {
if (precision < 0 || !fixed) {
exp = 0;
buf.push_back('0');
} else {