Reiseland Kontaktdaten, Rabatt API
This commit is contained in:
parent
8f29c15a2b
commit
70704be1ea
30 changed files with 471 additions and 95 deletions
|
|
@ -35,8 +35,12 @@ class Util
|
|||
}
|
||||
|
||||
public static function _clean_float($value){
|
||||
$groups = explode(".", preg_replace("/[^0-9.]/", "", str_replace(',', '.', $value)));
|
||||
$lastGroup = array_pop($groups);
|
||||
|
||||
$groups = explode(".", preg_replace("/[^0-9.-]/", "", str_replace(',', '.', $value)));
|
||||
$lastGroup = 0;
|
||||
if(count($groups) > 1){
|
||||
$lastGroup = array_pop($groups);
|
||||
}
|
||||
$number = implode('', $groups);
|
||||
return (strlen($lastGroup) < 3) ? floatval($number.'.'.$lastGroup) : floatval($number.$lastGroup);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue