Skip to content

Commit

Permalink
Fixes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
truenicoco committed Jul 21, 2020
1 parent d7cb6b3 commit 03d8793
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hh_creator/util.py
@@ -1,6 +1,6 @@
from decimal import Decimal, InvalidOperation
import logging
import locale
# import locale

from PyQt5 import QtCore, QtGui, uic, QtWidgets, Qt, QtMultimedia

Expand Down Expand Up @@ -139,9 +139,10 @@ def get_center(item, scene=False):

def amount_format(x, n_decimals):
if float(x).is_integer():
return locale.format_string("%d", x)
return f"{x:n}"
else:
return locale.format_string(f"%.{n_decimals}f", x)
x = round(x, n_decimals)
return f"{x:n}"


BLINDS = [ActionType.SB, ActionType.BB, ActionType.STRADDLE]
Expand Down

0 comments on commit 03d8793

Please sign in to comment.