Conditions | 8 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
22 | public static function humanToPlain($value) |
||
23 | { |
||
24 | if ($value === null) { |
||
25 | return null; |
||
26 | } |
||
27 | $l = substr($value, -1); |
||
28 | |||
29 | if (($l === 'k') || ($l === 'K')) { |
||
30 | return ((int)substr($value, 0, -1) * 1000); |
||
31 | } |
||
32 | |||
33 | if (($l === 'm') || ($l === 'M')) { |
||
34 | return ((int)substr($value, 0, -1) * 1000 * 1000); |
||
35 | } |
||
36 | |||
37 | if (($l === 'g') || ($l === 'G')) { |
||
38 | return ((int)substr($value, 0, -1) * 1000 * 1000 * 1000); |
||
39 | } |
||
40 | return (int)$value; |
||
41 | } |
||
42 | } |
||
43 |