sub() public method

Subtracts two BigNumber objects
public sub ( Decimal $b, integer $scale = null ) : Decimal
$b Decimal
$scale integer
return Decimal
Ejemplo n.º 1
0
 private function floorModulo(Decimal $x, Decimal $y) : Decimal
 {
     return $x->sub($y->mul($x->div($y)->floor()));
 }
Ejemplo n.º 2
0
 /**
  * Returns a new Money object that represents
  * the difference of this and an other Money object
  *
  * @param Money $money
  * @return Money
  */
 public function subtract(Money $money)
 {
     $this->assertSameCurrency($money);
     $amount = $this->amount->sub($money->amount, $this->getInnerPrecision());
     return $this->newInstance($amount);
 }