示例#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);
 }