Don't remove trailing zeros with #

This commit is contained in:
Victor Zverovich committed 2020-08-08 08:14:39 -07:00
1 parent e06ae32294
commit 4fd95e4b4d
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -1131,7 +1131,7 @@ int format_float(T value, int precision, float_specs specs, buffer<char>& buf) {
if (grisu_gen_digits(normalized, 1, exp, handler) == digits::error)
return snprintf_float(value, precision, specs, buf);
int num_digits = handler.size;
if (!fixed) {
if (!fixed && !specs.showpoint) {
// Remove trailing zeros.
while (num_digits > 0 && buf[num_digits - 1] == '0') {
--num_digits;