Refactor floating-point formatting

This commit is contained in:
Victor Zverovich
2019-11-27 07:32:29 -08:00
parent c68703c9f4
commit c3be0f593d
3 changed files with 35 additions and 37 deletions

View File

@@ -1128,7 +1128,7 @@ int snprintf_float(T value, int precision, float_specs specs,
char format[max_format_size];
char* format_ptr = format;
*format_ptr++ = '%';
if (specs.alt) *format_ptr++ = '#';
if (specs.trailing_zeros) *format_ptr++ = '#';
if (precision >= 0) {
*format_ptr++ = '.';
*format_ptr++ = '*';