0

I am going through the Angular Transloco library https://ngneat.github.io/transloco/, I have successfully installed and tried the examples https://ngneat.github.io/transloco/docs/plugins/locale/ all worked as expected. For example

<span>
   {{ 1000000 | translocoCurrency: 'symbol' : { minimumFractionDigits: 0 } }}
</span>

returns $1,000,000

Now I want to change or localise the currency from $ to let's say the Nigerian currency (NGN) but I can't find a way of doing this. I have gone through the documentation but that wasn't helpful.

fanbondi
  • 1,035
  • 5
  • 18
  • 37

1 Answers1

1

In TranslocoCurrencyPipe, the next parameter after 'symbol' is the currency code.

So you should do like this:

<span>
   {{ 1000000 | translocoCurrency: 'symbol' : { minimumFractionDigits: 0 }: 'NGN' }}
</span>
Kalas
  • 26
  • 2
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 30 '23 at 15:40
  • @Kalas, thanks for the contribution, this worked? – fanbondi Jun 03 '23 at 10:59