/** * @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); }
/** * @return int */ public function computePrecision() { return Math::floorLog($this->subunitsInUnit, 10); }
/** * @return int */ public function truncated() { return Math::quotient($this->toInt(), $this->currency->subunitsInUnit); }