Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public static function currencyStringToFloat($currencyString) |
||
17 | { |
||
18 | //currency is always in this format € 550 |
||
19 | |||
20 | return floatval( |
||
21 | str_replace( |
||
22 | ',', |
||
23 | '', |
||
24 | RegExp::getFirstMatch( |
||
25 | '/([+-]?[0-9]{1,3}(?:,?[0-9]{3})*(?:\.[0-9]{2})?)/', |
||
26 | $currencyString |
||
27 | ) |
||
28 | ) |
||
29 | ); |
||
30 | } |
||
31 | |||
49 | } |