mirror of
https://github.com/developersu/ns-usbloader.git
synced 2025-05-15 07:34:46 -04:00
Size displays now as GB/MB/kB
This commit is contained in:
parent
4cfd651667
commit
dc5ba1425b
5 changed files with 10 additions and 6 deletions
src/main/java/nsusbloader/Controllers
|
@ -16,7 +16,12 @@ public class NSLRowModel {
|
|||
this.nspFile = nspFile;
|
||||
this.markForUpload = checkBoxValue;
|
||||
this.nspFileName = nspFile.getName();
|
||||
this.nspFileSize = String.format("%.2f", nspFile.length()/1024.0/1024.0);
|
||||
if (nspFile.length()/1024.0/1024.0/1024.0 > 1)
|
||||
this.nspFileSize = String.format("%.2f", nspFile.length()/1024.0/1024.0/1024.0)+" GB";
|
||||
else if (nspFile.length()/1024.0/1024.0 > 1)
|
||||
this.nspFileSize = String.format("%.2f", nspFile.length()/1024.0/1024.0)+" MB";
|
||||
else
|
||||
this.nspFileSize = String.format("%.2f", nspFile.length()/1024.0)+" kB";
|
||||
this.status = "";
|
||||
}
|
||||
// Model methods start
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue