The Arcive of vBulletin Modifications Site. |
|
Percentage of PM Quota Used Details »»
|
|||||||||||||||||||||||||||||||
Percentage of PM Quota Used 4.0
Description: It show the percentage of PM quota that the user used. Installation:
Styles & Templates-> Style Manager-> Stylevars-> Private_Messages-> pm_percent Languages: - English History: 17-12-10: v4.0 First Release 29-12-10: v4.0.1 Fixed displayed porcentage This hack is created for your use free of charge. No payment is requested. However, if you would like to donate money for the work I put in to this hack, a donation would show your appreciation. Download Now
Screenshots
Show Your Support
|
|||||||||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
You're percentage seems to be off. It is showing 2 when it should be .013, or .01.
Quote:
This works: Code:
$totalpmpercent = $vbulletin->userinfo['pmtotal'] / $vbulletin->userinfo['permissions']['pmquota']; $pmpercent = vb_number_format($totalpmpercent, 2); |
|
#3
|
|||
|
|||
|
Quote:
It should be 1.3 but as I am using ceil function which returns the next highest value, it displays 2. I will use vb_number_format in next release. |
|
#4
|
||||
|
||||
|
13 divided by 1,000 is not 1.3, it is .013. I did a quota percent for my site a while back and have always used the code I posted. With ceil, it would show as .02. Just trying to help.
|
|
#5
|
|||
|
|||
|
Quote:
13 / 1000 * 100 = 1.3 |
|
#6
|
||||
|
||||
|
Okay, but that is not the true percentage then. The way I do it doesn't multiply by 100, which is misleading. No offense meant.
|
|
#7
|
|||
|
|||
|
Quote:
http://en.wikipedia.org/wiki/Percentage Or use: http://www.csgnetwork.com/csgpercent.html 13 is what percent of 1000? Result: 1.3 % |
|
#8
|
||||
|
||||
|
According to your second link, you are 100% right. It still doesn't look right to me, but I can't argue with it anymore. Sorry for my confusion. And here I thought was good in math in school.
![]() Here's what I came up with using your method: Code:
$pmpercent = vb_number_format($vbulletin->userinfo['pmtotal'] / $vbulletin->userinfo['permissions']['pmquota'] * 100, 2); |
|
#9
|
|||
|
|||
|
Quote:
Also I am thinking using round function. |
|
#10
|
||||
|
||||
|
Yes, round would be better. And thanks for catching me on the percentage error. I Have been doing it wrong all along, it seems.
|
![]() |
|
|