]> granicus.if.org Git - transmission/commitdiff
(trunk libT) truncate the fractions when formatting KB/s speeds
authorJordan Lee <jordan@transmissionbt.com>
Sun, 17 Jul 2011 14:15:02 +0000 (14:15 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sun, 17 Jul 2011 14:15:02 +0000 (14:15 +0000)
libtransmission/utils.c

index 2c8758e46fbf32a1b7b24997ad4f1a20b5055c8d..50e8c5003dd771894cdca215de01bef945cbcbed 100644 (file)
@@ -1730,7 +1730,7 @@ tr_formatter_speed_KBps( char * buf, double KBps, size_t buflen )
     double speed = KBps;
 
     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 {
         speed /= K;
         if( speed <= 99.995 ) /* 0.98 MB to 99.99 MB */