private static function roundToNearestIntegerIgnoringTies($amount)
    {
        $relevantDigit = substr(self::roundTowardsZero(bcmul($amount, '10', self::BCSCALE)), -1);

        $result = null;

        switch ($relevantDigit) {
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
                $result = self::roundTowardsZero($amount);
                break;
            case '5':
                $result = null; // handled by tie-breaking rules
                break;
            case '6':
            case '7':
            case '8':
            case '9':
                $result = self::roundAwayFromZero($amount);
                break;
        }

        return $result;
    }