@@ -43,10 +43,12 @@ |
||
| 43 | 43 | |
| 44 | 44 | public static function generaFormato($valor = 0, $simbolo = 'BsF', $decimal = 2) |
| 45 | 45 | { |
| 46 | - if (!is_numeric($valor)) |
|
| 47 | - throw new Exception("{$valor} debe indicar un número que sea válido"); |
|
| 48 | - if (!is_int($decimal)) |
|
| 49 | - throw new Exception("El valor {$decimal} no es válido"); |
|
| 46 | + if (!is_numeric($valor)) { |
|
| 47 | + throw new Exception("{$valor} debe indicar un número que sea válido"); |
|
| 48 | + } |
|
| 49 | + if (!is_int($decimal)) { |
|
| 50 | + throw new Exception("El valor {$decimal} no es válido"); |
|
| 51 | + } |
|
| 50 | 52 | |
| 51 | 53 | return $simbolo . ' ' . number_format($valor, $decimal, '.', ''); |
| 52 | 54 | } |