Sets the new amount of money.

@param integer|double $price Amount with two digits precision
337997
public function setValue( $price )
	{
		if ( $price == $this->getValue() ) { return; }

		$this->_checkPrice( $price );

		$this->_values['value'] = $this->_formatNumber( $price );
		$this->setModified();
	}
29279
public function setDiscount($discount)
    {
        $discount = (float) $discount;

        if ($discount > 1) {
            $discount = min(max($discount, 0), 100);
            $discount = $discount / 100;
        }

        $this->set('discount', $discount);
    }
1256649
protected function setValue($value)
    {
        if ($value === self::UNSUBSCRIBE)
        {
            $this->value = self::UNSUBSCRIBE;
        } else {
            $this->value = self::SUBSCRIBE;
        }
    }
100020
public function setCurrency($value)
    {
        $this->amount->setCurrency($value);
        foreach ($this->receipt->getItems() as $item) {
            $item->getPrice()->setCurrency($value);
        }

        return $this;
    }
921614
public function setPrice(Money $price): self
    {
        $this->updateCurrency($price);
        $this->price = (int) $price->getAmount();
        $this->updateTotalPrice();

        return $this;
    }
1151945
public function setAmount($amount)
    {
        if ($amount === null) {
            $this->amount = 0;
            return $this;
        }
        
        if (!is_int($amount)) {
            throw new InvalidArgumentException(sprintf(
                'Amount must be an integer, "%s" given',
                is_object($amount) ? get_class($amount) : gettype($amount)
            ));
        }
        
        // Overflow check is not necessary because we have an integer
        $this->amount = $amount;
        return $this;
    }
705282
public function setTotal($total)
    {
        NumericValidator::validate($total, "Total");
        $total = Formatter::formatToPrice($total, $this->getCurrency());
        $this->total = $total;
        return $this;
    }
300347
public function setPrice($amount)
    {
        $tax    = $this->getTaxRate()  / 100;
        $taxAmount = $amount * $tax;

        $this->prices = [
            'pretax' => round($amount, 2),
            'tax'    => round($taxAmount, 2),
            'net'    => round($amount + $taxAmount, 2),
        ];

        return $this;
    }
1257108
public function setAmount($amount)
    {
      if(!is_int($amount) || $amount < 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid amount, must be a positive integer');

      $this->amount = $amount;
    }
600027
public function setAmount($amount)
    {
        $effects = $this->unserializeEffects($this->getSerializedEffects());
        $effects['amount'] = \floatval($amount);
        $this->setEffects($effects);

        return $this;
    }
1194631
public void setBankPrice(double value) {
        getStorageHandler().getStorageEngine().setConfigEntry("bankprice", String.valueOf(value));
        bankPrice = value;
    }
1130492
public function setAmount($amount)
    {
        if (!Icepay_Parameter_Validation::amount($amount))
            throw new Exception('Please enter a valid amount (in cents)', 1003);

        $this->amount = $amount;
        return $this;
    }
584087
function setPrecision($bits)
    {
        $this->precision = $bits;
        if (MATH_BIGINTEGER_MODE != self::MODE_BCMATH) {
            $this->bitmask = new static(chr((1 << ($bits & 0x7)) - 1) . str_repeat(chr(0xFF), $bits >> 3), 256);
        } else {
            $this->bitmask = new static(bcpow('2', $bits, 0));
        }

        $temp = $this->_normalize($this);
        $this->value = $temp->value;
    }
1069274
public function add(Price $addend)
    {
        if (!$this->hasSameCurrency($addend)) {
            throw new InvalidCurrencyException($this->currency(), $addend->currency());
        }

        if ($this->precision !== $addend->precision) {
            throw new DifferentPricePrecisionException();
        }

        return new self($this->amount + $addend->amount, $this->currency(), $this->precision);
    }
1243375
public function setCosts( $price )
	{
		if ( $price == $this->getCosts() ) { return; }

		$this->_checkPrice( $price );

		$this->_values['costs'] = $this->_formatNumber( $price );
		$this->setModified();
	}
1076508
public function it_sets_price_in_createFromUnits()
    {
        $this->moneyFactory->createFromUnits(1010)->willReturn($this->createMoney(1010));
        $this->moneyFactory->createFromUnits(220)->willReturn($this->createMoney(220));

        $price = $this->createFromUnits(1010, 220);

        $price->getAmount()->getValue()->shouldReturn(10.10);
    }
784720
public function setValue($value)
    {
        if ($this->value instanceof Binding && !($value instanceof Binding)) {
            $this->value->setValue($value);
        } else {
            $this->value = $value;
        }
    }