Skip to main content
PProfileMatch
← Path

REST API Development · REST API Design: Endpoint Naming and JSON Payload Best Practices

0 XP
  1. 1 current stop: learning
  2. 2 upcoming
  3. 3 upcoming
  4. 4 upcoming
  5. 5 upcoming

Finish after stop 5

Stop 1 of 5 · Ticket counter at the clinic

Trick to keep in mind+3 XP

Money in whole paise as integers, plus a currency code. Floats make pennies wander.

Binary floating point cannot store most decimal fractions exactly, so sums pick up tiny errors. Whole numbers in the smallest unit add exactly, and a currency code removes guessing. A formatted string like "₹0.30" looks tidy but cannot be added without parsing it first.

print(0.1 + 0.2)        # 0.30000000000000004
print(10 + 20 == 30)    # True: whole paise add exactly

Read it once, then a question tests whether the trick stuck.