ccc

JS: Format number

Pasarlo a formato de euro:

function toEurosJS(cant) {
    cant = cant.toLocaleString("es-ES", {minimumFractionDigits: 2});
    return cant;
}

cant = toEurosJS(56789.666); // dará 56.789,66

No hay comentarios:

Publicar un comentario