from decimal import Decimal # total digits (for invoice item amounts) [docs] PRECISION = 8 # digits after the point (for invoice item amounts) [docs] SCALE = 2 # the maximum amount that can be precisely represented [docs] MAX_AMOUNT = Decimal(('9' * (PRECISION - SCALE)) + '.99')