Ignore:
Timestamp:
Jun 23, 2010, 8:14:30 PM (11 years ago)
Author:
charles
Message:

(trunk libT) formatter_get_size_str() -- we don't need decimal places when displaying bytes :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r10822 r10831  
    15811581    value = bytes / unit->value;
    15821582    units = unit->name;
    1583     precision = value < 100 ? 2 : 1;
     1583    if( unit->value == 1 )
     1584        precision = 0;
     1585    else if( value < 100 )
     1586        precision = 2;
     1587    else
     1588        precision = 1;
    15841589    tr_snprintf( buf, buflen, "%.*f %s", precision, value, units );
    15851590    return buf;
Note: See TracChangeset for help on using the changeset viewer.