Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 912b05e8 authored by Stephen Bird's avatar Stephen Bird
Browse files

Sizes: Let disk usage show sizes as doubles

This way, weird file system sizes display nicely.
Without this a mountpoint with a size of 1.68GB
displays as 1GB.

Change-Id: I72e0d8ff911dd942efd5860f2d86607ebbb30fcb
parent c91b03da
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -202,16 +202,20 @@ public final class FileHelper {
                                 R.string.size_gigabytes
                                };

        long aux = size;
        double aux = size;
        int cc = magnitude.length;
        for (int i = 0; i < cc; i++) {
            long s = aux / 1024;
            if (aux < 1024) {
                return Long.toString(aux) + " " + res.getString(magnitude[i]); //$NON-NLS-1$
                double cleanSize = Math.round(aux * 100);
                return Double.toString(cleanSize / 100) +
                        " " + res.getString(magnitude[i]); //$NON-NLS-1$
            } else {
                aux = aux / 1024;
            }
            aux = s;
        }
        return Long.toString(aux) + " " + res.getString(magnitude[cc - 1]); //$NON-NLS-1$
        double cleanSize = Math.round(aux * 100);
        return Double.toString(cleanSize / 100) +
                " " + res.getString(magnitude[cc - 1]); //$NON-NLS-1$
    }

    /**