Kernel::System::DataValidation::Validator::DecimalDigits

NAME

Kernel::System::DataValidation::Validator::DecimalDigits – Validator that checks if number exceeded maximum amount of decimal digits.

PUBLIC INTERFACE

Provides a Check method, that will be called by the Kernel::System::DataValidation backend.

Check()

Executes a check if the number has more decimal digits then defined. The patterns needs to be passed as the Arguments parameter.

    my $True = $Validator->Check(
        Arguments => [ 2 ],
        Value     => '123.45',
    );

    my $False = $Validator->Check(
        Arguments => [ 2 ],
        Value     => '123.456',
    );

    my $True = $Validator->Check(
        Arguments => {
            MaxDecimalDigits      => [ 2 ],
            ErrorMessage => 'Maximum decimal digits exeeded',
        },
        Value => '123.45',
    );
Scroll to Top