User Tools

Site Tools


format_number_in_javascript

Format Number in Javascript

See NumberFormat on Mozilla Developer Network

var number = 123456.789;

// request a currency format
console.log(new Intl.NumberFormat('de-DE', { minimumFractionDigits : 2, style: 'currency', currency: 'EUR' }).format(number));
// → 123.456,79 €

format_number_in_javascript.txt · Last modified: 2015/02/25 08:30 by mihael