Browse Source

Merge pull request #3758 from kartik-v/patch-7

Fix #3756: Convert values to float for number formatting
tags/2.0.0-rc
Alexander Makarov 10 years ago
parent
commit
8edda55057
  1. 1
      framework/CHANGELOG.md
  2. 2
      framework/base/Formatter.php

1
framework/CHANGELOG.md

@ -42,6 +42,7 @@ Yii Framework 2 Change Log
- Bug #3716: `DynamicModel::validateData()` does not call `validate()` if the `$rules` parameter is empty (qiangxue)
- Bug #3751: Fixed postgreSQL schema data for enum values, do not add values if there are none (makroxyz)
- Bug #3752: `QueryBuilder::batchInsert()` does not typecast input values (qiangxue)
- Bug #3756: Fix number formatting error for `\yii\base\Formatter` by converting strings to float (kartik-v)
- 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)

2
framework/base/Formatter.php

@ -436,7 +436,7 @@ class Formatter extends Component
$ds = isset($this->decimalSeparator) ? $this->decimalSeparator : '.';
$ts = isset($this->thousandSeparator) ? $this->thousandSeparator : ',';
return number_format($value, $decimals, $ds, $ts);
return number_format((float) $value, $decimals, $ds, $ts);
}
/**

Loading…
Cancel
Save