The value passed to to_currency, mirroring what Python’s dispatcher saw.
The int/non-int distinction is not cosmetic: base.to_currency branches on
isinstance(val, int) and skips the cents segment entirely for true ints,
while a float that happens to be whole (1.0) still renders cents.
has_decimal mirrors Python’s
isinstance(val, float) or str(val).find(".") != -1 — the guard that
decides whether the cents segment appears at all. It cannot be derived
from the parsed value: Decimal("5") and Decimal("5.00") are equal
numerically but only the second prints cents, while 1e21 is a float
whose repr has no dot yet still counts as decimal. So the flag is
computed on the Python side, where str(val) already lives.
isinstance(val, float) on the Python side. A handful of
converters (SQ) branch on the origin type, not the value:
float 12.34 renders cents, Decimal(“12.34”) does not. Cannot be
derived from value/has_decimal — Decimal(“5.00”) has a dot
yet is not a float.
Int from a decimal string, else Decimal. is_int and has_decimal
come from the Python side because only it can tell 1 from 1.0, or
Decimal("5") from Decimal("5.00").