/** * @return float|int * @throws \Granam\Integer\Tools\Exceptions\WrongParameterType * @throws \Granam\Integer\Tools\Exceptions\ValueLostOnCast */ public function getValue() { if ($this->getUnit() === self::ROUND) { // only rounds are always integer return ToInteger::toInteger(parent::getValue()); } return parent::getValue(); }
/** * @param float $value * @param string $unit */ public function __construct($value, $unit) { parent::__construct($value, $unit); }