Spaces:
Running
Running
File size: 1,545 Bytes
069fbff a1ad9ef 069fbff 6ac33e3 069fbff 6ac33e3 069fbff 6ac33e3 a1ad9ef 6ac33e3 a1ad9ef 5d1cac4 069fbff 5d1cac4 069fbff |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
import ssl
import logging
import gradio as gr
import matplotlib.pyplot as plt
from io import BytesIO
import base64
from datetime import datetime
# λ‘κ·Έ μ€μ
#logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
# SSL μΈμ¦μ κ²μ¦ λΉνμ±ν
ssl._create_default_https_context = ssl._create_unverified_context
current_time = datetime.now().strftime("%b-%d-%Y")
def load_css():
with open('style.css', 'r', encoding='utf-8') as file:
css = file.read()
return f"<style>{css}</style>"
def format_quantity(quantity):
# μμ£Ό μμ κ°μ 0μΌλ‘ μ²λ¦¬
if abs(quantity) < 1e-5: # μκ³κ°μ μ‘°μ νμ¬ λ μ μ ν κ°μ μ€μ ν μ μμ΅λλ€.
quantity = 0
if quantity < 0:
return f"({-quantity:,.1f})"
else:
return f"{quantity:,.1f}"
def format_value(value):
# μμ£Ό μμ κ°μ 0μΌλ‘ μ²λ¦¬
if abs(value) < 1e-5: # μκ³κ°μ μ‘°μ νμ¬ λ μ μ ν κ°μ μ€μ ν μ μμ΅λλ€.
value = 0
if value < 0:
return f"({-value:,.0f})"
else:
return f"{value:,.0f}"
# currency_symbols = {
# "KRW": "β©",
# "USD": "$",
# "CAD": "$",
# "EUR": "β¬",
# "JPY": "Β₯",
# "GBP": "Β£"
# }
currency_symbols = {
"KRW": "β©",
"USD": "$"
}
def get_currency_symbol(currency_code):
return currency_symbols.get(currency_code.upper(), "")
def get_currency_codes():
return list(currency_symbols.keys())
currency_codes = get_currency_codes()
|