API Testing · Middle · Question 37 of 75

Why are monetary amounts often sent as strings or integers of cents?

Show the answer

Correct answer: Floating-point numbers can't represent many decimals exactly

Explanation

0.1 + 0.2 isn't exactly 0.3 in floating point. Testers check rounding, currency and totals.

Further reading

Problem with a question

API Testing · Middle · question 37

Test yourself

Take the API Testing · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz