Example #1
0
 /**
  * @dataProvider ensureIntegerTrailingDecimalProvider
  *
  * @param mixed $value
  *
  * @covers \nochso\Omni\Numeric::ensureInteger
  */
 public function testEnsureInteger_WithTrailingDecimals_MustThrow($value)
 {
     $this->expectException('InvalidArgumentException');
     Numeric::ensureInteger($value);
 }
Example #2
0
 /**
  * setPrecision of floating point values after the decimal point.
  *
  * @param int $precision Any non-negative integer.
  *
  * @return $this
  */
 public function setPrecision($precision)
 {
     $this->precision = Numeric::ensureInteger($precision);
     return $this;
 }
Example #3
0
 /**
  * limitPeriods limits the amount of significant periods (years, months, etc.) to keep.
  *
  * Significant periods are periods with non-zero values.
  *
  * @param int $limit 0 for keeping all significant periods or any positive integer.
  *
  * @return $this
  */
 public function limitPeriods($limit)
 {
     $this->limit = Numeric::ensureInteger($limit);
     return $this;
 }