public function allocateToTargets($n)
    {
        if (is_int($n)) {
            $n = (float)$n;
        }

        if (!is_float($n)) {
            throw new InvalidArgumentException('$n ' . \Yii::t('skeeks/money', 'must be an integer'));
        }

        $low = $this->newMoney(floatval($this->amount / $n));
        $high = $this->newMoney($low->getAmount() + 1);
        $remainder = $this->amount % $n;
        $result = array();

        for ($i = 0; $i < $remainder; $i++) {
            $result[] = $high;
        }

        for ($i = $remainder; $i < $n; $i++) {
            $result[] = $low;
        }

        return $result;
    }