When retrieving data from the backend, I receive $0
, but I need to display it as $0.00
in my user interface.
<span [innerHTML]="session.balance | currency :'USD': true:'1.2-2'"></span>
I'm encountering an issue where the application fails when the backend
sends the balance as $0
, but works fine when it sends just the number 0
. This functionality was functioning correctly in Angular 1
using the currency
filter.
Removing the currency
filter also removes the two decimal places
that were previously displayed. I am unsure whether I should switch to using number : '1.2-2'
.