summaryrefslogtreecommitdiff
path: root/framework/I18N/core/NumberFormatInfo.php
diff options
context:
space:
mode:
authorxue <>2006-04-26 21:18:01 +0000
committerxue <>2006-04-26 21:18:01 +0000
commit8ab196ce6c2d5de323bdd8ebcc11a73814c0cdca (patch)
treee77b1306648d03920439290bb8f3e27821410804 /framework/I18N/core/NumberFormatInfo.php
parent5ba6cd4be568f686d890835a77586077cde1a943 (diff)
Merge from 3.0 branch till 971.
Diffstat (limited to 'framework/I18N/core/NumberFormatInfo.php')
-rw-r--r--framework/I18N/core/NumberFormatInfo.php18
1 files changed, 18 insertions, 0 deletions
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.