Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
attachment_ui: Use `Math.trunc` instead of `Math.parseInt`.
Lalit Kumar Singhbcb0406f9b41
diff --git a/web/src/attachments_ui.js b/web/src/attachments_ui.jsindex a83549d7ecb..4fdda567ca9 100644--- a/web/src/attachments_ui.js+++ b/web/src/attachments_ui.js@@ -23,7 +23,7 @@ export function bytes_to_size(bytes, kb_with_1024_bytes = false) {if (bytes === 0) {return "0 B";}- const i = Number.parseInt(Math.floor(Math.log(bytes) / Math.log(kb_size)), 10);+ const i = Math.trunc(Math.log(bytes) / Math.log(kb_size));let size = Math.round(bytes / Math.pow(kb_size, i));if (i > 0 && size < 10) {size = Math.round((bytes / Math.pow(kb_size, i)) * 10) / 10;