Sunday 29 April 2018

Formatting number in European format with two decimals using JavaScript.

set euro culture in javascript
Description:

In this example we explain that how to set Euro culture in JavaScript. Or how to display number in euro culture format using JavaScript. Or how to convert number into euro culture format in JavaScript. Or how to convert number into euro format currency using JavaScript. Or formatting currency for a culture in JavaScript.

So here we demonstrate that how to formatting number in European format with two decimal places using JavaScript.


Below is the one line JavaScript code that will convert number to euro currency format using JavaScript.

Code:

console.log(Number(12345678).toLocaleString("nl-NL", { minimumFractionDigits: 2 }));

Output:

12.345.678,00


0 comments:

Post a Comment