user3318489 user3318489 - 1 month ago 7
AngularJS Question

AngularJS - always show two digits after comma

Is there a possibility with AngularJS to always show two digits after the comma, also if the value is 0.
My current code looks like this:

Sum is <b>{{vm.accountsSummary.amountOfPaidAccounts}}</b>


and if vm.accountsSummary.amountOfPaidAccounts is 0 than 0 is shown but 0.00 should be shown.
Is there a possibility to do this?

Answer
{{vm.accountsSummary.amountOfPaidAccounts | number:2}}