def decimal_to_fixed(value, precision): """Convert a `Decimal` to a fixed-precision number as a string.""" return text_type(value.quantize(precision, rounding=ROUND_HALF_EVEN))