I wrote a unit test for a model attribute whose rule follows:
array('percent', 'numerical', 'allowEmpty' => true,
'integerOnly' => false, 'min' => 0, 'max' => 100),
The test only succeeds when I set the value to an integer. It fails for every float value. I’m using mySQL, and the column type is FLOAT.
I have even tried it using ‘min’=>0.0 and ‘max’=>100.0, but that doesn’t fix it.
What am I doing wrong? Thanks!