Bird
0
0

Given the pipe usage {{ 1234.5678 | number:'1.2-2' }}, what will be the displayed output?

medium📝 state output Q13 of 15
Angular - Pipes
Given the pipe usage {{ 1234.5678 | number:'1.2-2' }}, what will be the displayed output?
A1234.56
B1234.5678
C1,234.57
D1,234.5678
Step-by-Step Solution
Solution:
  1. Step 1: Understand the number pipe parameter

    The parameter '1.2-2' means minimum 1 digit before decimal, 2 minimum and 2 maximum digits after decimal.
  2. Step 2: Format the number 1234.5678 accordingly

    The number is rounded to 2 decimal places and includes thousand separator: '1,234.57'.
  3. Final Answer:

    1,234.57 -> Option C
  4. Quick Check:

    number pipe rounds decimals as per parameter [OK]
Quick Trick: Number pipe rounds decimals between min and max digits [OK]
Common Mistakes:
  • Ignoring thousand separators
  • Not rounding decimals
  • Confusing min and max decimal digits

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes