def get_dec_amount(str_amount_arg: str) -> Decimal:
# FIXME: Concentrating logic into a single point. Fix this, make type safe to avoid confusion. Quantity formats should be always clear
# FIXME: Review. This is just relocated code. It looks odd
# FIXME: Antipattern. Magic number.
# FIXME: Validate string, etc.
return decimal.Decimal(decimal.Decimal(str_amount_arg) * 100000000).quantize(decimal.Decimal('1'),
rounding=decimal.ROUND_HALF_UP)
评论列表
文章目录