MuleSoft Certified Developer – Level 1 — Question 67
What is the correct way to format the decimal 200.1234 as a string to two decimal places?
Answer options
- A. 200.1234 as string {format: ".0#"}
- B. 200.1234 as string as format: ".0#"
- C. 200.1234 as String {format: ".0#"}
- D. 200.1234 as String as format: ".0#"
Correct answer: C
Explanation
The correct answer is C, as it correctly uses the syntax for formatting a decimal to two decimal places with the appropriate capitalization of 'String'. Options A and B incorrectly use lowercase 'string', and option D includes an unnecessary 'as' that makes it syntactically incorrect.