Skip to content

Commit

Permalink
Added further new test cases for the new money implementation
Browse files Browse the repository at this point in the history
    Added the following cases
    - standard behaviour for an integer value
    - force 0 decimal digits for a number to be rounded at the lower integer
    - force 0 decimal digits for a number to be rounded at the upper integer
  • Loading branch information
Antonio Farina committed May 6, 2020
1 parent d6b1242 commit e345786
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/CosmoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ public function testMoney()

$actual = Cosmo::create('en_US')->money(12.3, 'aud');
$this->assertEquals('A$12.30', $actual);

$actual = Cosmo::create('en_AU')->money(12.32342, 'aud');
$this->assertEquals('$12.32', $actual);

$actual = Cosmo::create('en_AU')->money(12, 'aud');
$this->assertEquals('$12.00', $actual);

$actual = Cosmo::create('en_AU')->money(12.32342, 'aud', 0);
$this->assertEquals('$12', $actual);

$actual = Cosmo::create('en_AU')->money(12.62342, 'aud', 0);
$this->assertEquals('$13', $actual);


}

public function testOrdinal()
Expand Down

0 comments on commit e345786

Please sign in to comment.