aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-10-29 19:43:06 +0100
committerChristian Schneppe <christian@pix-art.de>2017-10-29 19:43:06 +0100
commit5059c7b46b1f988ae81c76cf303498e8a8d5b75f (patch)
tree16bf272656749bab121054d486e80be1d289fdab
parentddffbeee3ccf9eeef94586eed299291b0e12fc46 (diff)
MessageAdapter: round file sizes
-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";
}