nerdexam
MuleSoft

MCD-LEVEL-1 · Question #176

What is the correct way to format the decimal 200.1234 as a string to two decimal places?

The correct answer is B. 200.1234 as String {format: ".0#"}. Correct answer is 200.1234 as String {format: ".0#"} . Rest all options are not syntactically correct.

Use DataWeave to transform data

Question

What is the correct way to format the decimal 200.1234 as a string to two decimal places?

Options

  • A200.1234 as string as format: ".0#"
  • B200.1234 as String {format: ".0#"}
  • C200.1234 as String as format: ".0#"
  • D200.1234 as string {format: ".0#"}

How the community answered

(24 responses)
  • A
    4% (1)
  • B
    83% (20)
  • C
    4% (1)
  • D
    8% (2)

Explanation

Correct answer is 200.1234 as String {format: ".0#"} . Rest all options are not syntactically correct.

Topics

#DataWeave#number formatting#type coercion#format metadata

Community Discussion

No community discussion yet for this question.

Full MCD-LEVEL-1 Practice