From f21a3840e2486a298ec6976771888f02e3748ebb Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 27 May 2006 03:53:20 +0000 Subject: Fixed #162 and #163. --- .gitattributes | 2 ++ framework/I18N/core/NumberFormat.php | 5 ++--- .../FunctionalTests/tickets/protected/pages/Ticket163.page | 9 +++++++++ tests/FunctionalTests/tickets/protected/pages/config.xml | 3 +++ tests/FunctionalTests/tickets/tests/Ticket163TestCase.php | 14 ++++++++++++++ 5 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket163.page create mode 100644 tests/FunctionalTests/tickets/tests/Ticket163TestCase.php diff --git a/.gitattributes b/.gitattributes index 2db5261b..07dc529a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1048,6 +1048,7 @@ tests/FunctionalTests/tickets/protected/pages/Layout.php -text tests/FunctionalTests/tickets/protected/pages/Layout.tpl -text tests/FunctionalTests/tickets/protected/pages/Ticket121.page -text tests/FunctionalTests/tickets/protected/pages/Ticket121.php -text +tests/FunctionalTests/tickets/protected/pages/Ticket163.page -text tests/FunctionalTests/tickets/protected/pages/Ticket191.page -text tests/FunctionalTests/tickets/protected/pages/Ticket191.php -text tests/FunctionalTests/tickets/protected/pages/Ticket21.page -text @@ -1066,6 +1067,7 @@ tests/FunctionalTests/tickets/protected/pages/Ticket93.php -text tests/FunctionalTests/tickets/protected/pages/config.xml -text tests/FunctionalTests/tickets/protected/pages/hotspot.jpg -text tests/FunctionalTests/tickets/tests/Ticket121TestCase.php -text +tests/FunctionalTests/tickets/tests/Ticket163TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket191TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket21TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket27TestCase.php -text diff --git a/framework/I18N/core/NumberFormat.php b/framework/I18N/core/NumberFormat.php index d1184f86..8e715f15 100644 --- a/framework/I18N/core/NumberFormat.php +++ b/framework/I18N/core/NumberFormat.php @@ -122,7 +122,6 @@ class NumberFormat $string = (string)$number; - $decimal = $this->formatDecimal($string); $integer = $this->formatInteger(abs($number)); @@ -130,9 +129,9 @@ class NumberFormat $result = $integer.$decimal; else $result = $integer; - + //get the suffix - if($number > 0) + if($number >= 0) $suffix = $this->formatInfo->PositivePattern; else if($number < 0) $suffix = $this->formatInfo->NegativePattern; diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket163.page b/tests/FunctionalTests/tickets/protected/pages/Ticket163.page new file mode 100644 index 00000000..aa05e601 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket163.page @@ -0,0 +1,9 @@ + +

Test Ticket #163

+

Missing currency sign in TNumberFormat if Value is 0

+ +
+ +
+ +
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/config.xml b/tests/FunctionalTests/tickets/protected/pages/config.xml index 83bb5791..48a0114c 100644 --- a/tests/FunctionalTests/tickets/protected/pages/config.xml +++ b/tests/FunctionalTests/tickets/protected/pages/config.xml @@ -1,5 +1,8 @@ + + + \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket163TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket163TestCase.php new file mode 100644 index 00000000..cc78c466 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket163TestCase.php @@ -0,0 +1,14 @@ +open('tickets/index.php?page=Ticket163'); + $this->assertTextPresent('kr 100,00'); + $this->assertTextPresent('kr 0,00'); + $this->assertTextPresent('-kr 100,00'); + } +} + +?> \ No newline at end of file -- cgit v1.2.3