Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Calculate downloads floor
<?php
function download_floor($downloads) {
$length = strlen( $downloads );
$divider = intval( '1' . str_repeat( '0', $length - 1 ) );
return floor( $downloads / $divider ) * $divider;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment