I hope I get a solution for this.
I am using angular1.4.
I want to display time in decimal numbers(separated by comma because users are in Germany-Europe).
For example 5min is expected to be displayed as:
5min=(5/60)=0,08 (2 decimal places)
Then I came across this solution: AngularJS number filter. However the result appears in decimal, what can I add to this pipe filter below, to change/replace decimal to comma?
<span>{{ dr.duration/(60*60*1000) | number:2}}</span>
In case you need clarity lemme know.
To change the separators used by the AngularJS number filter, include the appropriate locale rule set such as angular-locale_de-de.js.
There are two approaches to providing locale rules to AngularJS:
index.htmlFor more information, see
<script src="//unpkg.com/angular/angular.js"></script>
<script src="//unpkg.com/angular-i18n/angular-locale_de-de.js"></script>
<body ng-app>
<span><b>5min=(5/60)=</b>
{{ 5/60 | number:2 }} hr (2 decimal places)
</span>
</body>
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