mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-13 18:58:04 +01:00
Shorter variable name, different approach to casting
This commit is contained in:
@@ -125,13 +125,13 @@ class NumberValidator extends Validator
|
||||
*/
|
||||
private function getStringValue($value)
|
||||
{
|
||||
$value = (string)$value;
|
||||
$value = "$value";
|
||||
|
||||
$localeInfo = localeconv();
|
||||
$decimalPointSeparator = isset($localeInfo['decimal_point']) ? $localeInfo['decimal_point'] : null;
|
||||
$decimalSeparator = isset($localeInfo['decimal_point']) ? $localeInfo['decimal_point'] : null;
|
||||
|
||||
if ($decimalPointSeparator !== null && $decimalPointSeparator !== '.') {
|
||||
$value = str_replace($decimalPointSeparator, '.', $value);
|
||||
if ($decimalSeparator !== null && $decimalSeparator !== '.') {
|
||||
$value = str_replace($decimalSeparator, '.', $value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
||||
Reference in New Issue
Block a user