User Tools

Site Tools


format_number_in_javascript

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

format_number_in_javascript [2015/02/20 09:25]
mihael created
format_number_in_javascript [2015/02/25 08:30] (current)
mihael
Line 7: Line 7:
  
 // request a currency format // request a currency format
-console.log(new Intl.NumberFormat('​de-DE',​ { style: '​currency',​ currency: '​EUR'​ }).format(number));​+console.log(new Intl.NumberFormat('​de-DE',​ { minimumFractionDigits : 2, style: '​currency',​ currency: '​EUR'​ }).format(number));​
 // → 123.456,79 € // → 123.456,79 €
 </​sxh>​ </​sxh>​
  
 {{tag>​javascript}} {{tag>​javascript}}
format_number_in_javascript.txt · Last modified: 2015/02/25 08:30 by mihael