DEV Community

dan-simiyu
dan-simiyu

Posted on

1

Answer: MySQL Round Up to Nearest 5 Cents

Since 100/5 = 20 all we do is multiply by 20, round up to the nearest whole number, and then divide by 20.

(To round up in MySQL use CEIL)

Example for $1.03:

1.03 * 20   = 20.60
CEIL(20.60) = 21.0000
21 / 20     = 1.0500

NOTE: I also round…

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay