예제 #1
0
파일: Integer.php 프로젝트: kdyby/money
 /**
  * @param self|int|string|float $arg
  * @throws InvalidArgumentException
  * @return int|float
  */
 protected function valueToNumber($arg)
 {
     if ($arg instanceof self) {
         return $arg->toInt();
     }
     return Math::parseNumber($arg);
 }
예제 #2
0
파일: Currency.php 프로젝트: pilec/Money
 /**
  * @return int
  */
 public function computePrecision()
 {
     return Math::floorLog($this->subunitsInUnit, 10);
 }
예제 #3
0
파일: Money.php 프로젝트: pilec/Money
 /**
  * @return int
  */
 public function truncated()
 {
     return Math::quotient($this->toInt(), $this->currency->subunitsInUnit);
 }