From 8ab196ce6c2d5de323bdd8ebcc11a73814c0cdca Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 26 Apr 2006 21:18:01 +0000 Subject: Merge from 3.0 branch till 971. --- framework/I18N/core/NumberFormatInfo.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'framework/I18N/core/NumberFormatInfo.php') diff --git a/framework/I18N/core/NumberFormatInfo.php b/framework/I18N/core/NumberFormatInfo.php index 15b9ee5d..3531cc7f 100644 --- a/framework/I18N/core/NumberFormatInfo.php +++ b/framework/I18N/core/NumberFormatInfo.php @@ -324,6 +324,13 @@ class NumberFormatInfo } } } + + if(is_int($decimalPos)) + $digitPattern = substr($pattern,0,$decimalPos); + else + $digitPattern = $pattern; + + $digitPattern = preg_replace('/[^0]/','',$digitPattern); $info['groupPos1'] = $groupPos1; $info['groupSize1'] = $groupSize1; @@ -331,6 +338,7 @@ class NumberFormatInfo $info['groupSize2'] = $groupSize2; $info['decimalPos'] = $decimalPos; $info['decimalPoints'] = $decimalPoints; + $info['digitSize'] = strlen($digitPattern); return $info; } @@ -365,6 +373,16 @@ class NumberFormatInfo return $this->pattern['decimalPoints'] = $value; } + function getDigitSize() + { + return $this->pattern['digitSize']; + } + + function setDigitSize($value) + { + $this->pattern['digitSize'] = $value; + } + /** * Gets the string to use as the decimal separator. * @return string decimal separator. -- cgit v1.2.3