Menu
mediumMr DIY · math

Round prices up, round loyalty points down

Mr DIY always rounds the billed price up to the nearest ringgit, and always rounds loyalty points (1 point per ringgit) down.

Return customer, price_before_rounding, billed_price (rounded up), and loyalty_points (rounded down).

Schema

purchases
idINT
customerTEXT
price_before_roundingNUMERIC

Example input

purchases
↑ Read the question

Keep going

Company names are trademarks of their respective owners, used here only to describe practice material. mahir_data is not affiliated with, endorsed by, or sponsored by any company named on this site. Terms.