How to get specific currency symbol(rupee symbol in my case) in angular js instead of the default one (dollar $ symbol)

前端 未结 11 1474
野性不改
野性不改 2020-12-13 06:29

When i use \'currency\' in angular js, I am getting a dollar symbol. How to get required currency symbols based on the requirements. As if now i need to know how to display

11条回答
  •  孤城傲影
    2020-12-13 07:01

    Currency pipe has 3 parameters

    1. Desire currency code.

    .

    2. A Boolean value to indicate whether to display the currency symbol.

    .

    3. Digit info(has 3 parts): consist of minimum number of integer digit, minimum number of fractional digit and maximum number of fractional digit.
    {{value| currency:'1':2:'3'}}
    

    Example

    {{9.667| currency:'USD':true:'2.2-3'}}
    

    Output

    $09.667

    Refer for more details: https://angular.io/api/common/CurrencyPipe

    For currency code: https://en.wikipedia.org/wiki/ISO_4217

    If you want to show the currency in Indian rupee. use code INR

    {{100| currency:'INR':true}}
    

    Output

    ₹100.00

提交回复
热议问题