mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
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:
parent
1469c7a131
commit
615ff74d5b
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue