user3139368 user3139368 - 4 months ago 18
AngularJS Question

Remove - symbol from number while displaying in html in Angular JS

I Want to remove "-" symbol from a negative number in Angular Js.

{{ obj.Fre - Airlines.IncFare | currency:Search.DCurr+ " " :0}}


This Expression returning value in Minus.
I want to remove - symbol.

Please help me.

Answer

Try

{{ (obj.Fre - Airlines.IncFare > 0 ? obj.Fre - Airlines.IncFare : Airlines.IncFare - obj.Fre) | currency:Search.DCurr+ " " :0}}
Comments