Fixed rounding errors in postcounts (view profile)

git-svn-id: file:///svn/phpbb/trunk@1915 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Bart van Bragt 2002-01-21 14:37:53 +00:00
parent 1469c7a131
commit 615ff74d5b

View file

@ -242,13 +242,13 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
$regdate = $profiledata['user_regdate'];
$memberdays = max(1, round( ( time() - $regdate ) / 86400 ));
$posts_per_day = sprintf("%.2f", $profiledata['user_posts'] / $memberdays);
$posts_per_day = $profiledata['user_posts'] / $memberdays;
// Get the users percentage of total posts
if( $profiledata['user_posts'] != 0 )
{
$total_posts = get_db_stat("postcount");
$percentage = ( $total_posts ) ? sprintf("%.2f", min(100, ($profiledata['user_posts'] / $total_posts) * 100)) : 0;
$percentage = ( $total_posts ) ? min(100, ($profiledata['user_posts'] / $total_posts) * 100) : 0;
}
else
{