Calculate downloads floor

I wanted to calculate the ratio of active theme installs versus theme downloads, but the calculation often seemed very unfair, for example when a theme has been downloaded 999 times, the “active_installs” number would reflect that as 900  on the WordPress API because it lists theme and plugin count in very round numbers ( 10s, 100s, 1000s, etc. ).

So to equalize things just a little bit – I made this little function:

I don’t know whether this is how WordPress is doing it, but for me, it seems to do the trick.