format: Use %G to print numbers
This avoids appending .000[...] on integer numbers
This commit is contained in:
parent
9f7c823103
commit
145fcddbed
1 changed files with 1 additions and 1 deletions
|
|
@ -107,7 +107,7 @@ bool
|
|||
apfl_format_put_number(struct apfl_format_writer w, apfl_number number)
|
||||
{
|
||||
char buf[PUT_NUMBER_BUFSIZE];
|
||||
size_t len = snprintf(buf, PUT_NUMBER_BUFSIZE, "%f", number);
|
||||
size_t len = snprintf(buf, PUT_NUMBER_BUFSIZE, "%.12G", number);
|
||||
TRY(write(w, buf, len));
|
||||
if (len >= PUT_NUMBER_BUFSIZE) {
|
||||
TRY(apfl_format_put_string(w, "[...]"));
|
||||
|
|
|
|||
Loading…
Reference in a new issue