fixes formatter doing one division too much, fixes #4427

This commit is contained in:
Kai Mindermann
2014-07-24 13:18:18 +02:00
committed by Alexander Makarov
parent f3520187d6
commit 46b553f012
3 changed files with 6 additions and 1 deletions

View File

@@ -71,6 +71,7 @@ Yii Framework 2 Change Log
- Bug #4342: mssql (dblib) driver does not support getting attributes (tof06)
- Bug #4409: Upper case letters in subdirectory prefixes of controller IDs were not properly handled (qiangxue)
- Bug #4412: Formatter used SI Prefixes for base 1024, now uses binary prefixes (kmindi)
- Bug #4427: Formatter could do one division too much (kmindi)
- Bug: Fixed inconsistent return of `\yii\console\Application::runAction()` (samdark)
- Bug: URL encoding for the route parameter added to `\yii\web\UrlManager` (klimov-paul)
- Bug: Fixed the bug that requesting protected or private action methods would cause 500 error instead of 404 (qiangxue)

View File

@@ -461,7 +461,7 @@ class Formatter extends Component
$value = $value / $this->sizeFormat['base'];
$position++;
} while ($position < 6);
} while ($position < 5);
$value = round($value, $this->sizeFormat['decimals']);
$formattedValue = isset($this->sizeFormat['decimalSeparator']) ? str_replace('.', $this->sizeFormat['decimalSeparator'], $value) : $value;