Browse Source

Removed the wholeSymbole and wholePosition options in favor of using custom patterns

Jose Lorenzo Rodriguez 11 years ago
parent
commit
ea2aa04e50
2 changed files with 4 additions and 16 deletions
  1. 0 4
      src/Utility/Number.php
  2. 4 12
      tests/TestCase/Utility/NumberTest.php

+ 0 - 4
src/Utility/Number.php

@@ -276,10 +276,6 @@ class Number {
  *
  * ### Options
  *
- * - `wholeSymbol` - The currency symbol to use for whole numbers,
- *   greater than 1, or less than -1.
- * - `wholePosition` - The position the whole symbol should be placed
- *   valid options are 'before' & 'after'.
  * - `fractionSymbol` - The currency symbol to use for fractional numbers.
  * - `fractionPosition` - The position the fraction symbol should be placed
  *   valid options are 'before' & 'after'.

+ 4 - 12
tests/TestCase/Utility/NumberTest.php

@@ -182,14 +182,14 @@ class NumberTest extends TestCase {
 		$expected = 'EUR 100 100 100,00';
 		$this->assertEquals($expected, $result);
 
-		$options = ['locale' => 'fr_FR', 'pattern' => '#,###.00 EUR'];
+		$options = ['locale' => 'fr_FR', 'pattern' => '#,###.00 ¤¤'];
 		$result = $this->Number->currency($value, 'EUR', $options);
 		$expected = '100 100 100,00 EUR';
 		$this->assertEquals($expected, $result);
 
-		$options = array('after' => 'øre', 'before' => 'Kr.', 'decimals' => ',', 'thousands' => '.');
-		$result = $this->Number->currency(1000.45, null, $options);
-		$expected = 'Kr.1.000,45';
+		$options = ['locale' => 'fr_FR', 'pattern' => '#,###.00;(¤#,###.00)'];
+		$result = $this->Number->currency(-1235.03, 'EUR', $options);
+		$expected = '(€1 235,03)';
 		$this->assertEquals($expected, $result);
 
 		$result = $this->Number->currency(0.5, 'USD');
@@ -200,14 +200,6 @@ class NumberTest extends TestCase {
 		$expected = '50øre';
 		$this->assertEquals($expected, $result);
 
-		$result = $this->Number->currency(1, null, array('wholeSymbol' => '$ '));
-		$expected = '$ 1.00';
-		$this->assertEquals($expected, $result);
-
-		$result = $this->Number->currency(1, null, array('wholeSymbol' => ' $', 'wholePosition' => 'after'));
-		$expected = '1.00 $';
-		$this->assertEquals($expected, $result);
-
 		$options = array('wholeSymbol' => '$', 'wholePosition' => 'after', 'fractionSymbol' => ' cents');
 		$result = $this->Number->currency(0.2, null, $options);
 		$expected = '20 cents';