public function allocate(array $ratios, $useGaapPrecision = false)
    {
        $useGaapPrecision ? $precision = self::GAAP_PRECISION : $precision = self::BASIC_PRECISION;

        $remainder = $this->amount;
        $results = [];
        $total = array_sum($ratios);

        foreach ($ratios as $ratio) {
            $share = bcdiv(
                bcmul(
                    $this->amount,
                    (string)$ratio,
                    $precision
                ),
                (string)$total,
                $precision
            );
            $results[] = new Money($share, $this->currency);
            $remainder = bcsub($remainder, $share, $precision);
        }

        $count = count($results) - 1;
        $index = 0;
        $minValue = '0.'.str_repeat('0', $precision - 1).'1';

        while (bccomp($remainder, '0'.str_repeat('0', $precision), $precision) !== 0) {
            $remainder = bcsub($remainder, $minValue, $precision);
            $results[$index] = $results[$index]->add(new Money($minValue, $this->currency));
            if ($index !== $count) {
                $index++;
            } else {
                $index = 0;
            }
        }

        return $results;
    }