Can anybody tell how to remove the currency symbol in AngularJS?
value = $filter('currency')(value);
I am getting a dollar symbol. I want to remove it.
I sadly don't yet have the required reputation to comment on an answer, but Samuel's answer needs a slight tweak. Just add the empty quotes, not value="".
<div> {{20 | currency:""}} </div>
Likewise you can use this same approach to override the dollar sign with any character, in this case pounds sterling:
<div> {{20 | currency:"£"}} </div>
or even use the named representation rather than the decimal:
<div> {{20 | currency:"£"}} </div>
Just pass empty string as second argument to the filter function.
value = $filter('currency')(value, "");
Also you can inject currencyFilter
itself. You do not have to derive it from the filter Factory, with that you would just do:
value = currencyFilter(value, "");
Note the syntax:
$filter('currency')(amount, symbol, fractionSize)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With