[eluser]landitus[/eluser]
I think extending the library would be nicer. Unfortunately I am not fluent enough in REGEX to do so. But I was able to do a minor hack to make the validation work with commas. Before validation I do a string replace to find the dot and turn it into a comma.
This is MY_Form_validation.php file
Code:
/**
* Money
*
* @access public
* @param string
* @return bool
*/
public function is_money($input) {
return (bool) preg_match('/^[0-9]+(\,[0-9]{0,2})?$/', $input);
}
/**
* Greather than Money
*
* @access public
* @param string
* @return bool
*/
function greater_than_money($str, $min)
{
$str = str_replace(",", ".", $str);
if ( ! is_numeric($str))
{
return FALSE;
}
return $str > $min;
}