diff options
author | xue <> | 2006-08-02 02:24:29 +0000 |
---|---|---|
committer | xue <> | 2006-08-02 02:24:29 +0000 |
commit | 550ba06593b467b643862d41a00ca2dd12ee704b (patch) | |
tree | 16ad8180c2f0b96454453effff89dc236469ee4f /framework/I18N/core/NumberFormat.php | |
parent | ccfa7850dc435ae9941cde18be827b3aac550f85 (diff) |
merge from 3.0 branch till 1320.
Diffstat (limited to 'framework/I18N/core/NumberFormat.php')
-rw-r--r-- | framework/I18N/core/NumberFormat.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/framework/I18N/core/NumberFormat.php b/framework/I18N/core/NumberFormat.php index 8e715f15..b30e615b 100644 --- a/framework/I18N/core/NumberFormat.php +++ b/framework/I18N/core/NumberFormat.php @@ -161,9 +161,14 @@ class NumberFormat $string = (string)$string;
$dp = strpos($string, '.');
+ $decimalDigits = $this->formatInfo->DecimalDigits;
+// var_dump($decimalDigits);
+ //if not decimal digits, assume 0 decimal points.
+ if(is_int($decimalDigits) && $decimalDigits > 0)
+ $string = (string)round(floatval($string),$decimalDigits);
if(is_int($dp))
- $string = substr($string, 0, $dp);
-
+ $string = substr($string, 0, $dp);
+
$integer = '';
$digitSize = $this->formatInfo->getDigitSize();
@@ -233,7 +238,9 @@ class NumberFormat $decimalDigits = $this->formatInfo->DecimalDigits;
$decimalSeparator = $this->formatInfo->DecimalSeparator;
-
+
+ //do the correct rounding here
+ //$string = round(floatval($string), $decimalDigits);
if(is_int($dp))
{
if($decimalDigits == -1)
|