From 3a8b47068f35743713a89a2026e87172fa6ab839 Mon Sep 17 00:00:00 2001 From: dsyoon Date: Sun, 7 Sep 2025 19:28:52 +0900 Subject: [PATCH] init --- monitor.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/monitor.py b/monitor.py index 99de20a..032ab7b 100644 --- a/monitor.py +++ b/monitor.py @@ -444,8 +444,20 @@ class Monitor(HTS): # ------------- Formatting ------------- def format_message(self, symbol: str, symbol_name: str, close: float, signal: str, buy_amount: float) -> str: message = f"[매수] {symbol_name} ({symbol}): " - message += f"₩{close:.4f}" - message += f" (₩{buy_amount:.4f})" + + if int(close) >= 1: + message += f"₩{close:.3f}" + message += f" (₩{buy_amount:.3f})" + elif int(close) >= 10: + message += f"₩{close:.2f}" + message += f" (₩{buy_amount:.2f})" + elif int(close) >= 100: + message += f"₩{close}" + message += f" (₩{buy_amount})" + else: + message += f"₩{close:.4f}" + message += f" (₩{buy_amount:.4f})" + if signal != '': message += f"[{signal}]" return message