src/Money.php
public static function ofMinor($minorAmount, $currency, Context $context = null, int $roundingMode = RoundingMode::UNNECESSARY) : Money
    {
        if (! $currency instanceof Currency) {
            $currency = Currency::of($currency);
        }

        if ($context === null) {
            $context = new DefaultContext();
        }

        $amount = BigRational::of($minorAmount)->dividedBy(10 ** $currency->getDefaultFractionDigits());

        return self::create($amount, $currency, $context, $roundingMode);
    }
public static function ofMinor($minorAmount, $currency, Context $context = null, int $roundingMode = RoundingMode::UNNECESSARY) : Money
    {
        if (! $currency instanceof Currency) {
            $currency = Currency::of($currency);
        }

        if ($context === null) {
            $context = new DefaultContext();
        }

        $amount = BigRational::of($minorAmount)->dividedBy(10 ** $currency->getDefaultFractionDigits());

        return self::create($amount, $currency, $context, $roundingMode);
    }
public static function ofMinor ( $ minorAmount , $ currency , Context $ context = null , int $ roundingMode = RoundingMode :: UNNECESSARY ) : Money { if ( ! $ currency instanceof Currency ) { $ currency = Currency :: of ( $ currency ) ; } if ( $ context === null ) { $ context = new DefaultContext ( ) ; } $ amount = BigRational :: of ( $ minorAmount ) -> dividedBy ( 10 ** $ currency -> getDefaultFractionDigits ( ) ) ; return self :: create ( $ amount , $ currency , $ context , $ roundingMode ) ; }
Returns a Money from a number of minor units.

By default, the money is created with a DefaultContext. This means that the amount is scaled to match the
currency's default fraction digits. For example, `Money::ofMinor(1234, 'USD')` will yield `USD 12.34`.
If the amount cannot be safely converted to this scale, an exception is thrown.

@param BigNumber|number|string $minorAmount  The amount, in minor currency units.
@param Currency|string|int     $currency     The Currency instance, ISO currency code or ISO numeric currency code.
@param Context|null            $context      An optional Context.
@param int                     $roundingMode An optional RoundingMode, if the amount does not fit the context.

@return Money

@throws UnknownCurrencyException If the currency is an unknown currency code.
@throws MathException            If the amount cannot be converted to a BigInteger.
Returns a Money from a number of minor units .