diff --git a/src/studio/kdb/Session.java b/src/studio/kdb/Session.java index 91d4d383..cc281e0d 100644 --- a/src/studio/kdb/Session.java +++ b/src/studio/kdb/Session.java @@ -13,6 +13,8 @@ import javax.swing.*; import java.io.IOException; +import java.text.DecimalFormat; +import java.text.NumberFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -31,6 +33,8 @@ public class Session implements ConnectionStateListener, KAuthentication { private final static Map sessions = new HashMap<>(); + private final static NumberFormat NUMBER_FORMAT = new DecimalFormat("#,###"); + public static Session newSession(EditorTab editor) { Server server = editor.getServer(); Session session; @@ -67,7 +71,7 @@ public void checkIncomingLimit(long msgLength) throws IOException { KdbMessageLimitAction action = Config.getInstance().getEnum(Config.KDB_MESSAGE_SIZE_LIMIT_ACTION); long limit = 1_000_000L * Config.getInstance().getInt(Config.KDB_MESSAGE_SIZE_LIMIT_MB); if (msgLength < limit) return; - final String msg = "Incoming message size " + msgLength + " breached the limit of " + limit + "."; + final String msg = "Incoming message size " + NUMBER_FORMAT.format(msgLength) + " breached the limit of " + NUMBER_FORMAT.format(limit) + "."; if (action == KdbMessageLimitAction.BLOCK) { throw new IOException(msg); }