Returning the length of the File in B/KB/MB
Logic

You can simplify your logic by testing for the biggest known extension, for example

if (fileSize &gt; 1024 * 1024)
    doMiB();
} else if (fileSize &gt; 1024) {
    doKiB();
} else {
    doByte();
}


Rounding

Don't use Math.round(x / 100.0) * 100. for rounding to two decimal places use the appropriate library function

Argument checking

Don't use default values ("Unknown") for invalid input. If the input to your getFileSize method is not a file, throw an exception

if (!file.isFile()) {
    throw new IllegalArgumentException("Expected argument to be a file");
}


Fast return

This is more personal taste but I prefer to return as soon as possible. If you know the result will be "100.31 KiB" why save it into a local variable instead of returning it immediately?

Conclusion

I would improve the code as followed

private static final DecimalFormat format = new DecimalFormat("#.##");
private static final long MiB = 1024 * 1024;
private static final long KiB = 1024;

public String getFileSize(File file) {

    if (!file.isFile()) {
        throw new IllegalArgumentException("Expected a file");
    }
    final double length = file.length();

    if (length &gt; MiB) {
        return format.format(length / MiB) + " MiB";
    }
    if (length &gt; KiB) {
        return format.format(length / KiB) + " KiB";
    }
    return format.format(length) + " B";
}