Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide currency symbol in angular currency pipe

I'm trying to use Angular currency pipe and I wanted to remove the currency symbol all together from the formatted number, but it seems there is no option to do that. So is there any easy way to achieve this without writing a custom pipe for it?

like image 320
Sinandro Avatar asked Jul 04 '19 16:07

Sinandro


People also ask

How would you display currency and the currency symbol of a foreign country?

If the currency type is in question, the symbol may include a country prefix, such as CA$, Can$ or C$ for Canadian dollars, or US$ for U.S. dollars. The € symbol is used to represent the euro currency, ¥ represents the Japanese yen, and ƒ signifies a florin, such as the Aruban Florin.

What is the use of CurrencyPipe in angular?

CurrencyPipelink. Transforms a number to a currency string, formatted according to locale rules that determine group sizing and separator, decimal-point character, and other locale-specific configurations.


2 Answers

Just send the arguments empty:

price | currency:'':''
like image 100
JuanF Avatar answered Sep 20 '22 11:09

JuanF


As @R.Richards mentioned, I ended up using the number pipe:

{{ 50000 | number }} <!-- output: 50,000 -->
like image 43
Sinandro Avatar answered Sep 21 '22 11:09

Sinandro