Short syntax for applied operation.

(cherry picked from commit a391e21)
This commit is contained in:
Yuriy Pikhtarev 2017-05-05 01:07:16 +03:00 committed by Vasily Komrakov
commit 1daec3c319
No known key found for this signature in database
GPG key ID: 558236680C20A69A
5 changed files with 8 additions and 8 deletions

View file

@ -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 = '&nbsp;')
$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];
}