diff --git a/src/bika/cement/utils.py b/src/bika/cement/utils.py index 3a2403b..8601cfe 100644 --- a/src/bika/cement/utils.py +++ b/src/bika/cement/utils.py @@ -4,8 +4,11 @@ def format_number(value, decimal_places=2): if value in (None, ""): return None - if isinstance(value, int): - return value # Return as-is if it's an integer + if isinstance(value, (int, long)): + try: + return int(value) # Return as-is if it's an integer + except OverflowError: + return value try: num = float(value)