Hacker News new | ask | show | jobs
by wildmanx 1409 days ago
> since 7 doesn't increase cleanly, I probably have to custom-code the final update to 100 manually,

What do you mean with "not cleanly"?

bar.update_smooth(i * 100 / 7)

Once i is 7, this will be equal to 100. No matter your rounding mode. You don't need a CS degree for that formula.