protected function unitAmount(float $amount, string $currency): int
    {
        switch (mb_strtoupper($currency)) {
            case 'BIF':
            case 'DJF':
            case 'JPY':
            case 'KRW':
            case 'PYG':
            case 'VND':
            case 'XAF':
            case 'XPF':
            case 'CLP':
            case 'GNF':
            case 'KMF':
            case 'MGA':
            case 'RWF':
            case 'VUV':
            case 'XOF':
                return (int) $amount;

            default: // In cents.
                return (int) ($amount * 100);
        }
    }
protected function unitAmount(float $amount, string $currency): int
    {
        switch (mb_strtoupper($currency)) {
            case 'BIF':
            case 'DJF':
            case 'JPY':
            case 'KRW':
            case 'PYG':
            case 'VND':
            case 'XAF':
            case 'XPF':
            case 'CLP':
            case 'GNF':
            case 'KMF':
            case 'MGA':
            case 'RWF':
            case 'VUV':
            case 'XOF':
                return (int) $amount;

            default: // In cents.
                return (int) ($amount * 100);
        }
    }
protected function unitAmount ( float $ amount , string $ currency ) : int { switch ( mb_strtoupper ( $ currency ) ) { case 'BIF' : case 'DJF' : case 'JPY' : case 'KRW' : case 'PYG' : case 'VND' : case 'XAF' : case 'XPF' : case 'CLP' : case 'GNF' : case 'KMF' : case 'MGA' : case 'RWF' : case 'VUV' : case 'XOF' : return ( int ) $ amount ; default : // In cents. return ( int ) ( $ amount * 100 ) ; } }
Smallest currency unit.

@since 170329.13807 Stripe utils.

@param float  $amount   Amount.
@param string $currency Currency code.

@return int Amount represented as an integer (always).

@see Units explained here <http://jas.xyz/2meM1pO>
Smallest currency unit .