mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-04 06:37:55 +08:00
Fix #3756: Convert values to float for number formatting
Convert string values to floating point, so that `number_format` method can properly format values.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user