mirror of https://github.com/zlatinb/muwire
fix download size in renderer, thanks Aegon
parent
bcce55b873
commit
80e165b505
|
@ -22,9 +22,8 @@ class DownloadProgressRenderer extends DefaultTableCellRenderer {
|
||||||
int done = d.donePieces()
|
int done = d.donePieces()
|
||||||
int percent = -1
|
int percent = -1
|
||||||
if (pieces != 0)
|
if (pieces != 0)
|
||||||
percent = (int)(done * 100.0 / pieces)
|
percent = (done * 100 / pieces)
|
||||||
long size = d.pieceSize * ((long) pieces)
|
String totalSize = DataHelper.formatSize2Decimal(d.length, false) + "B"
|
||||||
String totalSize = DataHelper.formatSize2Decimal(size, false) + "B"
|
|
||||||
setText(String.format("%2d", percent) + "% of ${totalSize} ($done/$pieces pcs)".toString())
|
setText(String.format("%2d", percent) + "% of ${totalSize} ($done/$pieces pcs)".toString())
|
||||||
|
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
|
|
Loading…
Reference in New Issue