protected function getClosestAcceptedCashAmount($amount): int
    {
        $value = Number::fromString($amount)->getIntegerPart();
        $cent = $amount % 5;

        if ($cent <= 2) {
            $value = $value - $cent;
        } else {
            $value = $value + (5 - $cent);
        }

        return $value;
    }
protected function getClosestAcceptedCashAmount($amount): int
    {
        $value = Number::fromString($amount)->getIntegerPart();
        $cent = $amount % 5;

        if ($cent <= 2) {
            $value = $value - $cent;
        } else {
            $value = $value + (5 - $cent);
        }

        return $value;
    }
protected function getClosestAcceptedCashAmount ( $ amount ) : int { $ value = Number :: fromString ( $ amount ) -> getIntegerPart ( ) ; $ cent = $ amount % 5 ; if ( $ cent <= 2 ) { $ value = $ value - $ cent ; } else { $ value = $ value + ( 5 - $ cent ) ; } return $ value ; }
Get closest accepted cash amount.

@param  int|string  $amount

@return int
Get closest accepted cash amount .