mirror of
https://github.com/transmission/transmission
synced 2025-03-04 02:28:03 +00:00
(trunk libT) #3462 "minor json formatting optimization: omit unnecessary floating-point precision" -- done.
This commit is contained in:
parent
52922f89f1
commit
6d445f29eb
1 changed files with 2 additions and 2 deletions
|
@ -1349,8 +1349,8 @@ jsonRealFunc( const tr_benc * val, void * vdata )
|
|||
struct jsonWalk * data = vdata;
|
||||
char locale[128];
|
||||
|
||||
if( fabs( val->val.d ) < 0.00001 )
|
||||
evbuffer_add( data->out, "0", 1 );
|
||||
if( fabs( val->val.d - (int)val->val.d ) < 0.00001 )
|
||||
evbuffer_add_printf( data->out, "%d", (int)val->val.d );
|
||||
else {
|
||||
/* json requires a '.' decimal point regardless of locale */
|
||||
tr_strlcpy( locale, setlocale( LC_NUMERIC, NULL ), sizeof( locale ) );
|
||||
|
|
Loading…
Add table
Reference in a new issue