diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-10-29 19:43:06 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-10-29 19:43:06 +0100 |
commit | 5059c7b46b1f988ae81c76cf303498e8a8d5b75f (patch) | |
tree | 16bf272656749bab121054d486e80be1d289fdab /src/main/java/de | |
parent | ddffbeee3ccf9eeef94586eed299291b0e12fc46 (diff) |
MessageAdapter: round file sizes
Diffstat (limited to 'src/main/java/de')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 4 |
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"; } |