| Conditions | 6 |
| Paths | 9 |
| Total Lines | 15 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace eoxia; |
||
| 22 | public function convert_to($input, $format, $convert = true) { |
||
| 23 | if($format == 'oc') |
||
| 24 | return $input; |
||
| 25 | $multiple = 0; |
||
| 26 | if($format == 'ko') |
||
| 27 | $multiple = 1024; |
||
| 28 | else if($format == 'mo') |
||
| 29 | $multiple = 1048576; |
||
| 30 | else if($format == 'go') |
||
| 31 | $multiple = 1073741824; |
||
| 32 | if($convert) |
||
| 33 | return $input * $multiple; |
||
| 34 | else |
||
| 35 | return $input / $multiple; |
||
| 36 | } |
||
| 37 | } |
||
| 40 |