Angular 2 formatting currency BRL format

前端 未结 11 2474
梦毁少年i
梦毁少年i 2021-02-19 14:52

I\'m trying to use pipe to format the price of an item in PT-BR currency format.

Here what i\'m trying to do:

{{statement
11条回答
  •  日久生厌
    2021-02-19 15:32

    You can set the locale-id. Import the module as follows:

    import {LOCALE_ID} from '@angular/core';
    

    And in your module define a provider like this:

    providers: [
        {
          provide: LOCALE_ID,
          useValue: "en-US"
        }
    ]
    

    Just exchange for your locale ID (for IDs, refer to the Angular documentation).

提交回复
热议问题