Merge pull request #6715 from turbo124/v5-develop
FIxes for parsing string floats
This commit is contained in:
commit
b2e2210a46
1 changed files with 3 additions and 3 deletions
|
|
@ -61,12 +61,12 @@ class Number
|
|||
// convert "," to "."
|
||||
$s = str_replace(',', '.', $value);
|
||||
|
||||
if($value < 1)
|
||||
return (float)$s;
|
||||
|
||||
// remove everything except numbers and dot "."
|
||||
$s = preg_replace("/[^0-9\.]/", '', $s);
|
||||
|
||||
if($s < 1)
|
||||
return (float)$s;
|
||||
|
||||
// remove all seperators from first part and keep the end
|
||||
$s = str_replace('.', '', substr($s, 0, -3)).substr($s, -3);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue