round() 공개 메소드

"Rounds" the Decimal to have at most $scale digits after the point
public round ( integer $scale ) : Decimal
$scale integer
리턴 Decimal
예제 #1
0
파일: Money.php 프로젝트: coolms/money
 /**
  * Useful for payment systems that don't use high precision
  *
  * @param int $roundingMode
  * @return Decimal
  */
 public function toUnits($roundingMode = self::ROUND_HALF_UP)
 {
     $this->assertRoundingMode($roundingMode);
     $precision = $this->getPrecision();
     if (null === $roundingMode) {
         return $this->amount->round($precision);
     }
     return Math::bcround($this->amount, $precision, $roundingMode);
 }