From fae41f1742e72ae59fca23a53e37f6b03c45c676 Mon Sep 17 00:00:00 2001 From: Wolf Posdorfer Date: Sun, 6 Oct 2019 20:58:47 +0200 Subject: [PATCH] #26 change param to double, to allow double arithmetic --- .../java/nsusbloader/Controllers/NSTableViewController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/nsusbloader/Controllers/NSTableViewController.java b/src/main/java/nsusbloader/Controllers/NSTableViewController.java index abf299e..fdcd415 100644 --- a/src/main/java/nsusbloader/Controllers/NSTableViewController.java +++ b/src/main/java/nsusbloader/Controllers/NSTableViewController.java @@ -220,13 +220,13 @@ public class NSTableViewController implements Initializable { } - private String formatByteSize(long length) { + private String formatByteSize(double length) { final String[] unitNames = { "bytes", "KiB", "MiB", "GiB", "TiB"}; int i; for (i = 0; length > 1024 && i < unitNames.length - 1; i++) { length = length / 1024; } - return String.format("%,d %s", length, unitNames[i]); + return String.format("%,.2f %s", length, unitNames[i]); } } \ No newline at end of file