@@ -46,10 +46,12 @@ |
||
| 46 | 46 | $simbolo = isset($options['s']) ? $options['s'] : 'BsF'; |
| 47 | 47 | $decimal = isset($options['d']) ? $options['d'] : 2; |
| 48 | 48 | |
| 49 | - if (!is_numeric($valor)) |
|
| 50 | - throw new Exception("{$valor} debe indicar un número que sea válido"); |
|
| 51 | - if (!is_int($decimal)) |
|
| 52 | - throw new Exception("El valor {$decimal} no es válido"); |
|
| 49 | + if (!is_numeric($valor)) { |
|
| 50 | + throw new Exception("{$valor} debe indicar un número que sea válido"); |
|
| 51 | + } |
|
| 52 | + if (!is_int($decimal)) { |
|
| 53 | + throw new Exception("El valor {$decimal} no es válido"); |
|
| 54 | + } |
|
| 53 | 55 | |
| 54 | 56 | return $simbolo . ' ' . number_format($valor, $decimal, '.', ''); |
| 55 | 57 | } |