Example #1
0
 /**
  * @param \AGmakonts\STL\Number\RoundingMode $mode
  * @param int $precision
  * @return NumberInterface
  */
 public function round(RoundingMode $mode, $precision = 0)
 {
     return self::get(round($this->value(), $precision, $mode->getValue()));
 }
Example #2
0
 /**
  * @param \AGmakonts\STL\Number\RoundingMode $mode
  *
  * @return \AGmakonts\STL\Number\Integer
  */
 public function round(RoundingMode $mode)
 {
     return self::get(round($this->value(), 0, $mode->getValue()));
 }
Example #3
0
 public function testRound()
 {
     $decimal = Decimal::get(4.094);
     $result = $decimal->round(RoundingMode::DOWN(), 2);
     $this->assertEquals(4.09, $result->value());
 }