aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
index 4223852dd..6cd1dc6ac 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
@@ -201,9 +201,9 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
if (message.getType() == Message.TYPE_IMAGE || message.getType() == Message.TYPE_FILE || message.getTransferable() != null) {
FileParams params = message.getFileParams();
if (params.size > (1 * 1024 * 1024)) {
- filesize = params.size / (1024 * 1024) + " MiB";
+ filesize = Math.round(params.size * 1f / (1024 * 1024)) + " MiB";
} else if (params.size >= (1 * 1024)) {
- filesize = params.size / 1024 + " KiB";
+ filesize = Math.round(params.size * 1f / 1024) + " KiB";
} else if (params.size > 0){
filesize = params.size + " B";
}