@@ -14,12 +14,12 @@ |
||
| 14 | 14 | |
| 15 | 15 | public function decimal($num, $decimals) { |
| 16 | 16 | if (!is_numeric($num)) return $num; |
| 17 | - return number_format((float)$num, $decimals, $this->locale['decimal_separator'], $this->locale['thousands_separator']); |
|
| 17 | + return number_format((float) $num, $decimals, $this->locale['decimal_separator'], $this->locale['thousands_separator']); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function currency($num) { |
| 21 | 21 | $num = $this->decimal($num, $this->locale['currency_decimals']); |
| 22 | - if ($this->locale['currency_position'] === 'before') return $this->locale['currency'] . $num; |
|
| 23 | - else return $num . $this->locale['currency']; |
|
| 22 | + if ($this->locale['currency_position'] === 'before') return $this->locale['currency'].$num; |
|
| 23 | + else return $num.$this->locale['currency']; |
|
| 24 | 24 | } |
| 25 | 25 | } |
@@ -13,13 +13,18 @@ |
||
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | public function decimal($num, $decimals) { |
| 16 | - if (!is_numeric($num)) return $num; |
|
| 16 | + if (!is_numeric($num)) { |
|
| 17 | + return $num; |
|
| 18 | + } |
|
| 17 | 19 | return number_format((float)$num, $decimals, $this->locale['decimal_separator'], $this->locale['thousands_separator']); |
| 18 | 20 | } |
| 19 | 21 | |
| 20 | 22 | public function currency($num) { |
| 21 | 23 | $num = $this->decimal($num, $this->locale['currency_decimals']); |
| 22 | - if ($this->locale['currency_position'] === 'before') return $this->locale['currency'] . $num; |
|
| 23 | - else return $num . $this->locale['currency']; |
|
| 24 | + if ($this->locale['currency_position'] === 'before') { |
|
| 25 | + return $this->locale['currency'] . $num; |
|
| 26 | + } else { |
|
| 27 | + return $num . $this->locale['currency']; |
|
| 28 | + } |
|
| 24 | 29 | } |
| 25 | 30 | } |