What is the Angular currency pipe code for Angola country

Viewed 817

I am trying to output the price of products, but I would like to know the currencyCode for Angola in Angular

I hope there is some code that can identify the currency of Angola

This is the variable that receive the value:

cur2 = 10.263782; 

Here i use the curency pipe:

{{cur2 | currency:'USD':true:'2.2-4'}} 

Tis is the output:

$10.2638

I've tried it this way:

{{cur2 | currency:'AOA':true:'2.2-4'}}

this too:

{{cur2 | currency:'AKZ':true:'2.2-4'}}
{{cur2 | currency:'KZ':true:'2.2-4'}}

and it was unsuccessful

2 Answers

It looks like Angolan currency is currently only available as a narrow symbol. Therefore the following should do the trick:

{{cur2 | currency:'AOA':'symbol-narrow':'2.2-4'}}

The previous answer is right. But I try to explain 'why?' not only for you but for other people who will read your question. Yes for Angola currency in the angular pipe we need use 'symbol-narrow'. Official documentation of angular explains that for transforming value using currency pipe we need to use format like:

{{ value_expression | currency [ : currencyCode [ : display [ : digitsInfo [ : locale ] ] ] ] }}

In your question, we are only interested in the parameter display.

And documentation gives this description of this parameter for us:

  • code: Show the code (such as USD).
  • symbol(default): Show the symbol (such as $).
  • symbol-narrow: Use the narrow symbol for locales that have two symbols for their currency. For example, the Canadian dollar CAD has the symbol CA$ and the symbol-narrow $. If the locale has no narrow symbol, uses the standard symbol for the locale.
  • String: Use the given string value instead of a code or a symbol. For example, an empty string will suppress the currency & symbol. Boolean (marked deprecated in v5): true for symbol and false for code.

Anngolan currency has two symbols for its designation Kz and kz.

When you use true angular understand that thay needs to use the symbol. But you have two symbols for designation this currency in your locale. That's why this parameter did not work for you.

Related