DEV Community

ludy.dev
ludy.dev

Posted on • Originally published at apycalc.net

How I handled floating-point math nightmares in a zero-dependency APY calculator

This guarantees that 1.005 rounds perfectly to 1.01 instead of getting stuck due to binary float representation issues.

Optimizing for 100/100 Lighthouse Scores

Beyond the math, my goal was pure performance. The site is built with static HTML, Tailwind CSS, and vanilla JS. This means there is zero hydration lag, no heavy frameworks to load, and a layout shift (CLS) of exactly zero.

If you've ever tried to calculate compound interest online, you've probably been bombarded by slow, ad-ridden bank calculators that take 5 seconds to load. I wanted to prove that you can build a utility tool that loads in under 100 milliseconds, respects user privacy, and does the math right.

Check it out at apycalc.net and let me know how you handle high-precision calculations in your lightweight web apps!

Top comments (0)