Bird
0
0

You want to display a product price in Euros with the currency symbol and exactly 3 decimal places in Angular. Which pipe usage is correct?

hard📝 Application Q15 of 15
Angular - Pipes
You want to display a product price in Euros with the currency symbol and exactly 3 decimal places in Angular. Which pipe usage is correct?
A{{ price | currency:'EUR':'code':'1.2-2' }}
B{{ price | currency:'EUR':'symbol':'1.3-3' }}
C{{ price | currency:'EUR':'symbol':'1.0-2' }}
D{{ price | currency:'USD':'symbol':'1.3-3' }}
Step-by-Step Solution
Solution:
  1. Step 1: Identify the currency code and symbol usage

    To show Euros with symbol €, use currency code 'EUR' and display 'symbol'.
  2. Step 2: Set decimal places to exactly 3

    The digit info '1.3-3' means minimum 1 digit before decimal, exactly 3 decimals.
  3. Step 3: Check other options for correctness

    {{ price | currency:'EUR':'code':'1.2-2' }} uses 'code' display and 2 decimals; C uses 2 decimals; D uses USD instead of EUR.
  4. Final Answer:

    {{ price | currency:'EUR':'symbol':'1.3-3' }} -> Option B
  5. Quick Check:

    Currency EUR with 3 decimals = {{ price | currency:'EUR':'symbol':'1.3-3' }} [OK]
Quick Trick: Use '1.3-3' for exactly 3 decimals in currency pipe [OK]
Common Mistakes:
  • Using wrong currency code or symbol
  • Setting wrong decimal places
  • Mixing currency codes (USD instead of EUR)

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes