|
@@ -156,6 +156,9 @@ class TokenDisplayFormatter:
|
|
|
"""
|
|
|
Format a price with appropriate decimal places.
|
|
|
"""
|
|
|
+ if price is None:
|
|
|
+ return "N/A"
|
|
|
+
|
|
|
try:
|
|
|
decimal_places = 2
|
|
|
if token:
|
|
@@ -172,7 +175,12 @@ class TokenDisplayFormatter:
|
|
|
return f"{price:,.{decimal_places}f}"
|
|
|
except Exception as e:
|
|
|
logger.error(f"❌ Error formatting price {price} for {token}: {e}")
|
|
|
- return f"{price:,.2f}"
|
|
|
+
|
|
|
+
|
|
|
+ try:
|
|
|
+ return f"{price:,.2f}"
|
|
|
+ except:
|
|
|
+ return str(price)
|
|
|
|
|
|
def format_price_with_symbol(self, price: float, token: str = None) -> str:
|
|
|
"""
|