Browse files

adding tests for places that will leave a trailing 0 because of the w…

…ay phps number_format() method works

Signed-off-by: mark_story <mark@mark-story.com>
  • Loading branch information...
1 parent c55a579 commit 96b30f0547dd9e85d768e05da83a2dd702b5812b @dogmatic69 dogmatic69 committed with markstory Dec 1, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 cake/tests/cases/libs/view/helpers/number.test.php
View
8 cake/tests/cases/libs/view/helpers/number.test.php
@@ -321,6 +321,14 @@ function testCurrencyOptions() {
$expected = '&#163;1,234,568';
$this->assertEqual($expected, $result);
+ $result = $this->Number->currency('1234567.8912345', null, array('before' => 'GBP', 'places' => 3));
+ $expected = 'GBP1,234,567.891';
+ $this->assertEqual($expected, $result);
+
+ $result = $this->Number->currency('650.120001', null, array('before' => 'GBP', 'places' => 4));
+ $expected = 'GBP650.1200';
+ $this->assertEqual($expected, $result);
+
$result = $this->Number->currency($value, 'GBP', array('escape' => true));
$expected = '&amp;#163;1,234,567.89';
$this->assertEqual($expected, $result);

0 comments on commit 96b30f0

Please sign in to comment.