Use %g instead of %f for double formatting
This can probably be refined further. This is just an improvement to get rid of unnecessary trailing zeroes.
This commit is contained in:
parent
de2dd71bf3
commit
932b593a58
1 changed files with 1 additions and 1 deletions
2
json.c
2
json.c
|
|
@ -117,7 +117,7 @@ void json_add_long(Json* json, long value)
|
|||
void json_add_double(Json* json, double value)
|
||||
{
|
||||
begin_value(json);
|
||||
fprintf(json->stream, "%f", value);
|
||||
fprintf(json->stream, "%g", value);
|
||||
end_value(json);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue