I am using following syntax to format euro amount in angular
{{ 20,00 | currency : "€" : 2}}
what produces
"20.00€"
Is there any simple way to format (using this syntax) the Euro price with comma instead of dot. so like
"20,00€"
?
https://docs.angularjs.org/api/ng/filter/currency
For localisation angular leverages i18n for localization and gloablization of applications. Using the euro symbol will not give you the formatting of comma vs. period.
https://docs.angularjs.org/guide/i18n
You'll need to include the formatting by including the correct i18n script in your project. Here's the example from angular if your application needs german formatting.
<html ng-app>
<head>
….
<script src="angular.js"></script>
<script src="i18n/angular-locale_de-de.js"></script>
….
</head>
</html>
If you need to format your currency based upon the symbol for the currency though, you'll need to implement a custom filter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With