fix download size in renderer, thanks Aegon

pull/9/head
Zlatin Balevsky 2019-07-07 11:17:56 +01:00
parent bcce55b873
commit 80e165b505
1 changed files with 2 additions and 3 deletions

View File

@ -22,9 +22,8 @@ class DownloadProgressRenderer extends DefaultTableCellRenderer {
int done = d.donePieces()
int percent = -1
if (pieces != 0)
percent = (int)(done * 100.0 / pieces)
long size = d.pieceSize * ((long) pieces)
String totalSize = DataHelper.formatSize2Decimal(size, false) + "B"
percent = (done * 100 / pieces)
String totalSize = DataHelper.formatSize2Decimal(d.length, false) + "B"
setText(String.format("%2d", percent) + "% of ${totalSize} ($done/$pieces pcs)".toString())
if (isSelected) {