user3318489 user3318489 - 1 year ago 61
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}}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download