Jigar Naik
Jigar Naik

Reputation: 1994

AngularJS added currency symbol makes Number Blank

I have below expression in AngularJS which displays a number with 2 decimal places.

{{detail.exit | number : 2}}

But when i add currency symbol as below, the number becomes blank on UI for few of the records.

{{detail.exit | number : 2 | currency}}

Anybody faces this issue before ? I i remove the currency symbol the number is getting displayed properly.

Upvotes: 1

Views: 25

Answers (2)

Rohit Shedage
Rohit Shedage

Reputation: 25920

this works perfect

{{detail.exit | currency:"USD$":2}}

please replace currency symbol to whatever you want.

Refer for more Details

Upvotes: 1

Jigar Naik
Jigar Naik

Reputation: 1994

Issue resolved by removing the number : 2 from the expression since currency seems to be formatting the number in 2 decimal places internally.

{{detail.exit | currency}}

Upvotes: 0

Related Questions