PHP Class Phalcon\Validation\Validator\Decimal
Validates that a value is a valid number in proper decimal format (negative and decimal numbers allowed).
Optionally, a specific number of digits can be checked too.
Uses {@link http://www.php.net/manual/en/function.localeconv.php locale conversion} to allow decimal point to be
locale specific.
use Phalcon\Validation\Validator\Decimal;
$validator->add('number', new Decimal([
'places' => 2,
'digit' => 3, // optional
'point' => ',' // optional. uses to override system decimal point
'message' => 'Price must contain valid decimal value',
]));
ファイルを表示
Open project: phalcon/incubator
Public Methods
Method Details