Skip to content

Commit

Permalink
add round up case
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Mar 3, 2021
1 parent 015a773 commit 57b3dd5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/ConnectionRoundTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,14 @@ public function testRound()
$this->assertEquals('0.33333333', (string) $row['val']);
$this->assertEqualsWithDelta(round(1 / 3, 8), (float) $row['val'], 0.0001);
}

public function testRoundUp()
{
$query = 'SELECT ROUND(0.16666666666666, 8) AS val FROM ' . self::TEST_TABLE_NAME;
$row = $this->getConnection()->getPRow($query);

$this->assertEquals('0.16666667', (string) $row['val']);
$this->assertEqualsWithDelta(round(1 / 6, 8), (float) $row['val'], 0.0001);
}
}

0 comments on commit 57b3dd5

Please sign in to comment.