Bird
0
0

Given the Angular template code:

medium📝 state output Q13 of 15
Angular - Pipes
Given the Angular template code:
{{ 1234.5 | currency:'USD':'symbol':'1.2-2' }}

What will be the rendered output?
A$1,234.50
B$1234.5
CUSD 1234.50
D$1,234.5
Step-by-Step Solution
Solution:
  1. Step 1: Understand the currency pipe parameters

    The currency pipe format is: currency code 'USD', display as symbol '$', and digit info '1.2-2' means minimum 1 digit before decimal, minimum 2 decimals, maximum 2 decimals.
  2. Step 2: Apply formatting to the number 1234.5

    Number 1234.5 is formatted with commas and two decimals: $1,234.50.
  3. Final Answer:

    $1,234.50 -> Option A
  4. Quick Check:

    Currency pipe with '1.2-2' = two decimals [OK]
Quick Trick: Currency pipe '1.2-2' means two decimals [OK]
Common Mistakes:
  • Ignoring decimal places and showing one decimal
  • Using currency code instead of symbol
  • Not adding thousand separators

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes