You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
k4ever/k4ever/api2/helper.py

14 lines
274 B

from decimal import Decimal, InvalidOperation
def getInt(d, key, default):
try:
return int(d.get(key, default))
except ValueError:
return default
def getDecimal(d, key, default):
try:
return Decimal(d.get(key, default))
except InvalidOperation:
return default