Show one month at a time, and change month with calendar and buttons
This commit is contained in:
@ -16,11 +16,11 @@ class Moneda extends Model {
|
||||
protected static $fields = ['denominacion', 'codigo'];
|
||||
|
||||
public function format($valor) {
|
||||
return implode('', [
|
||||
return trim(implode('', [
|
||||
$this->prefijo,
|
||||
number_format($valor, $this->decimales, ',', '.'),
|
||||
$this->sufijo
|
||||
]);
|
||||
]));
|
||||
}
|
||||
public function cambio(\DateTime $fecha) {
|
||||
$cambio = $this->factory->find(TipoCambio::class)
|
||||
@ -43,4 +43,14 @@ class Moneda extends Model {
|
||||
}
|
||||
return $cambio->transform($valor);
|
||||
}
|
||||
|
||||
public function toArray(): array {
|
||||
$arr = parent::toArray();
|
||||
$arr['format'] = [
|
||||
'prefijo' => $this->prefijo,
|
||||
'sufijo' => $this->sufijo,
|
||||
'decimales' => $this->decimales
|
||||
];
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user