INR currency format

前端 未结 19 1802
栀梦
栀梦 2020-12-09 17:31

I need to show currency format like these, how can we show.

₹1
₹10
₹100
₹1,000
₹10,000
₹1,00,000
......
19条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 18:01

    I believe the currency pipe will solve this problem

    Note: Syntax for digit param in the symbol is -> "numberOfInteger:minimumFractions-maxFractions"

    Input: {{1499 | currency:'INR':'symbol':'1.0'}}

    Output: ₹1,499

    Explanation -> '1.0' means currency pipe will display at least 1 digits and no decimal.

    Let me provide you with another example:

    Input: {{99 | currency:'INR':'symbol':'3.2-2'}}

    Output: ₹099.00

    Explanation -> '3.2-2' means currency pipe will display at least 3 digits and the decimal point minimum 2 fractions & maximum 2 fractions are displayed.

提交回复
热议问题