user3318489 user3318489 - 9 months ago 48
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 Source
{{vm.accountsSummary.amountOfPaidAccounts | number:2}}