Skip to main content

decimal_encoder

Encodes a Decimal as int of there's no exponent, otherwise float.

def decimal_encoder(
dec_value: Decimal
) - > int | float

Encodes a Decimal as int of there's no exponent, otherwise float.

Parameters

NameTypeDescription
dec_valueDecimalThe Decimal value to be converted into a standard numeric type.

Returns

TypeDescription
`intfloat`