public static function compare($amountA, $amountB)
    {
        $precision = (int) self::config()->get('precision');
        if (function_exists('bccomp') && self::config()->get('useBcMath')) {
            return bccomp($amountA, $amountB, $precision);
        }

        $scale = pow(10, max(0, $precision));
        $a = (int)($scale * $amountA);
        $b = (int)($scale * $amountB);

        return max(-1, min(1, $a - $b));
    }