(trunk libT) truncate the fractions when formatting KB/s speeds

This commit is contained in:
Jordan Lee 2011-07-17 14:15:02 +00:00
parent 2863ee49c9
commit efc306a8d3
1 changed files with 1 additions and 1 deletions

View File

@ -1730,7 +1730,7 @@ tr_formatter_speed_KBps( char * buf, double KBps, size_t buflen )
double speed = KBps; double speed = KBps;
if( speed <= 999.95 ) /* 0.0 KB to 999.9 KB */ if( speed <= 999.95 ) /* 0.0 KB to 999.9 KB */
tr_snprintf( buf, buflen, "%.2f %s", speed, speed_units.units[TR_FMT_KB].name ); tr_snprintf( buf, buflen, "%d %s", (int)speed, speed_units.units[TR_FMT_KB].name );
else { else {
speed /= K; speed /= K;
if( speed <= 99.995 ) /* 0.98 MB to 99.99 MB */ if( speed <= 99.995 ) /* 0.98 MB to 99.99 MB */