mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Short syntax for applied operation.
(cherry picked from commit a391e21
)
This commit is contained in:
parent
748476b802
commit
1daec3c319
5 changed files with 8 additions and 8 deletions
|
@ -843,7 +843,7 @@ function declension($int, $expressions, $format = '%1$s %2$s')
|
|||
if ($count >= 5 && $count <= 20) {
|
||||
$result = $expressions['2'];
|
||||
} else {
|
||||
$count = $count % 10;
|
||||
$count %= 10;
|
||||
if ($count == 1) {
|
||||
$result = $expressions['0'];
|
||||
} elseif ($count >= 2 && $count <= 4) {
|
||||
|
@ -901,12 +901,12 @@ function humn_size($size, $rounder = null, $min = null, $space = ' ')
|
|||
$rnd = $rounders[0];
|
||||
|
||||
if ($min == 'KB' && $size < 1024) {
|
||||
$size = $size / 1024;
|
||||
$size /= 1024;
|
||||
$ext = 'KB';
|
||||
$rounder = 1;
|
||||
} else {
|
||||
for ($i = 1, $cnt = count($sizes); ($i < $cnt && $size >= 1024); $i++) {
|
||||
$size = $size / 1024;
|
||||
$size /= 1024;
|
||||
$ext = $sizes[$i];
|
||||
$rnd = $rounders[$i];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue