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

What is the correct way to format the decimal 200.1234 as a string to two decimal places?
A . 200.1234 as string as format: ".0#"
B . 200.1234 as String {format: ".0#"}
C . 200.1234 as String as format: ".0#"
D . 200.1234 as string {format: ".0#"}

Answer: B

Explanation:

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

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments