Don't remove trailing zeros with #

This commit is contained in:
Victor Zverovich
2020-08-08 08:14:39 -07:00
parent e06ae32294
commit 4fd95e4b4d
2 changed files with 2 additions and 1 deletions

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;