summaryrefslogtreecommitdiff
path: root/framework/I18N
diff options
context:
space:
mode:
authorwei <>2006-08-01 01:25:57 +0000
committerwei <>2006-08-01 01:25:57 +0000
commitf8fe7d47cc5adb3c9e1901082c65c8766441f09e (patch)
tree7af5bc55f65021a43f0d5867e692f93c68ee8840 /framework/I18N
parente90a074753e4e5b9c65fc80eaf48526eb3824f15 (diff)
Fixed #285
Diffstat (limited to 'framework/I18N')
-rw-r--r--framework/I18N/core/NumberFormat.php13
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)