I am trying to validate a decimal value, i do use naturalNumber but did not recognize a value as 1,00 as greater than zero.
How can i work with decimal values using Cakephp 2 validation ? (0,01) would be accepted!
I try :
$this->loadModel('SomeModel');
$data = array(
'decimal_value' => '0,01',
);
$this->SomeModel->save($data);
class SomeModel extends AppModel {
public $validate = array(
'naturalNumber' => array(
'rule' => 'naturalNumber',
'message' => 'Value must be grater than 0',
'required' => true
)
)
);
}