Browse Source

Use NumberFormatter at the top of file

CauanCabral 11 years ago
parent
commit
782322b808
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/Validation/Validation.php

+ 4 - 3
src/Validation/Validation.php

@@ -16,6 +16,7 @@ namespace Cake\Validation;
 
 use Cake\Utility\Text;
 use LogicException;
+use NumberFormatter;
 use RuntimeException;
 
 /**
@@ -480,9 +481,9 @@ class Validation
 
         // account for localized floats.
         $locale = ini_get('intl.default_locale') ?: 'en_US';
-        $formatter = new \NumberFormatter($locale, \NumberFormatter::DECIMAL);
-        $decimalPoint = $formatter->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL);
-        $groupingSep = $formatter->getSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL);
+        $formatter = new NumberFormatter($locale, NumberFormatter::DECIMAL);
+        $decimalPoint = $formatter->getSymbol(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL);
+        $groupingSep = $formatter->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL);
 
         $check = str_replace($groupingSep, '', $check);
         $check = str_replace($decimalPoint, '.', $check);