Change 10.2019

This commit is contained in:
Kevin Adametz 2019-10-28 11:31:16 +01:00
parent 7fbac395a9
commit 8f29c15a2b
6 changed files with 27 additions and 277 deletions

View file

@ -31,8 +31,17 @@ class Util
public static function _format_number($value){
return preg_replace("/[^0-9,]/", "", $value);
}
public static function _clean_float($value){
$groups = explode(".", preg_replace("/[^0-9.]/", "", str_replace(',', '.', $value)));
$lastGroup = array_pop($groups);
$number = implode('', $groups);
return (strlen($lastGroup) < 3) ? floatval($number.'.'.$lastGroup) : floatval($number.$lastGroup);
}
public static function sanitize($string, $force_lowercase = true, $anal = false, $substr = false)
{
$strip = array("~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", "[", "{", "]",