Javascript examples for Language Basics:Intl
Use Javascript Intl.NumberFormat
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/* ww w . java2 s . c o m*/ var amount = 5000.25; var locale = 'de'; var options = {style: 'currency', currency: 'eur', minimumFractionDigits: 2, maximumFractionDigits: 2}; var formatter = new Intl.NumberFormat(locale, options); console.log(formatter.format(amount)); } </script> </head> <body> </body> </html>