Skip to main content

DecimalValidator

Validate that the input does not exceed the maximum number of digits expected, otherwise raise ValidationError.

Attributes

AttributeTypeDescription
messagesdictA dictionary of error message templates used to raise ValidationErrors for invalid numbers, exceeding total digits, exceeding decimal places, or exceeding whole digits.

Constructor

Signature

def DecimalValidator(
max_digits: int,
decimal_places: int
)

Parameters

NameTypeDescription
max_digitsintThe maximum number of digits allowed in the number.
decimal_placesintThe maximum number of decimal places allowed.