<?php

namespace App\Support;

use Illuminate\Support\Number;

class Format
{
    public static function money(null|int|float|string $value): string
    {
        if ($value === null || $value === '') {
            $value = 0;
        }

        // Si en algún punto decides almacenar en centavos,
        // aquí podrías dividir por 100 antes de formatear.
        return Number::currency(
            (float) $value,
            'COP',
            locale: 'es_CO',
        );
    }
}
