static _roundValue(inputValue, settings, decimalPlacesToRoundTo) {
        //XXX Note; this function is static since we need to pass a `settings` object when calling the static `AutoNumeric.format()` method
        if (AutoNumericHelper.isNull(inputValue)) {
            // Prevent rounding a `null` value
            return inputValue;
        }

        //TODO Divide this function to make it easier to understand
        inputValue = (inputValue === '') ? '0' : inputValue.toString();
        if (settings.roundingMethod === AutoNumeric.options.roundingMethod.toNearest05 ||
            settings.roundingMethod === AutoNumeric.options.roundingMethod.toNearest05Alt ||
            settings.roundingMethod === AutoNumeric.options.roundingMethod.upToNext05 ||
            settings.roundingMethod === AutoNumeric.options.roundingMethod.downToNext05) {
            return this._roundCloseTo05(inputValue, settings);
        }

        const [negativeSign, preparedValue] = AutoNumeric._prepareValueForRounding(inputValue, settings);
        inputValue = preparedValue;

        const decimalCharacterPosition = inputValue.lastIndexOf('.');
        const inputValueHasNoDot = decimalCharacterPosition === -1; // No dot character is found in the `inputValue`
        const [integerPart, decimalPart] = inputValue.split('.'); // Here the decimal character is always a period '.'
        const hasDecimals = decimalPart > 0;

        // If no decimals are detected
        if (!hasDecimals &&
            (settings.allowDecimalPadding === AutoNumeric.options.allowDecimalPadding.never ||
            settings.allowDecimalPadding === AutoNumeric.options.allowDecimalPadding.floats)) {
            // If the value decimalPart is only one or more zeroes, then it needs to be removed from the resulting string (cf. issue #652)
            return (Number(inputValue) === 0) ? integerPart : `${negativeSign}${integerPart}`;
        }

        // Else there are some decimal places that may need to be rounded
        // Sets the truncate zero method
        let temporaryDecimalPlacesOverride;
        if (settings.allowDecimalPadding === AutoNumeric.options.allowDecimalPadding.always ||
            settings.allowDecimalPadding === AutoNumeric.options.allowDecimalPadding.floats) {
            temporaryDecimalPlacesOverride = decimalPlacesToRoundTo;
        } else if (settings.allowDecimalPadding > 0) {
            temporaryDecimalPlacesOverride = settings.allowDecimalPadding;
        } else {
            temporaryDecimalPlacesOverride = 0;
        }

        // Define the decimal position to use (use the very last position if there are no dot in the initial inputValue)
        const decimalPositionToUse = inputValueHasNoDot ? inputValue.length - 1 : decimalCharacterPosition;
        // Checks decimal places to determine if rounding is required
        let checkDecimalPlaces = (inputValue.length - 1) - decimalPositionToUse;
        let inputValueRounded = '';

        // Check if no rounding is required
        if (checkDecimalPlaces <= decimalPlacesToRoundTo) {
            // Check if we need to pad with zeros
            inputValueRounded = inputValue;
            if (checkDecimalPlaces < temporaryDecimalPlacesOverride) {
                if (inputValueHasNoDot) {
                    inputValueRounded = `${inputValueRounded}${settings.decimalCharacter}`;
                }

                let zeros = '000000'; //TODO Change that string with a longer one to prevent having to loop numerous times in the next `while` statement?
                while (checkDecimalPlaces < temporaryDecimalPlacesOverride) {
                    zeros = zeros.substring(0, temporaryDecimalPlacesOverride - checkDecimalPlaces);
                    inputValueRounded += zeros;
                    checkDecimalPlaces += zeros.length;
                }
            } else if (checkDecimalPlaces > temporaryDecimalPlacesOverride) {
                inputValueRounded = this._truncateZeros(inputValueRounded, temporaryDecimalPlacesOverride);
            } else if (checkDecimalPlaces === 0 && temporaryDecimalPlacesOverride === 0) {
                // Remove any trailing dot, if any
                inputValueRounded = inputValueRounded.replace(/\.$/, '');
            }

            return (Number(inputValueRounded) === 0) ? inputValueRounded : `${negativeSign}${inputValueRounded}`;
        }

        // Rounded length of the string after rounding
        let roundedStrLength;
        if (inputValueHasNoDot) {
            roundedStrLength = decimalPlacesToRoundTo - 1;
        } else {
            roundedStrLength = Number(decimalPlacesToRoundTo) + Number(decimalCharacterPosition);
        }

        const lastDigit = Number(inputValue.charAt(roundedStrLength + 1));
        let inputValueArray = inputValue.substring(0, roundedStrLength + 1).split('');
        let odd;
        if (inputValue.charAt(roundedStrLength) === '.') {
            odd = inputValue.charAt(roundedStrLength - 1) % 2;
        } else {
            odd = inputValue.charAt(roundedStrLength) % 2;
        }

        if (this._shouldRoundUp(lastDigit, settings, negativeSign, odd)) {
            // Round up the last digit if required, and continue until no more 9's are found
            for (let i = (inputValueArray.length - 1); i >= 0; i -= 1) {
                if (inputValueArray[i] !== '.') {
                    inputValueArray[i] = +inputValueArray[i] + 1;
                    if (inputValueArray[i] < 10) {
                        break;
                    }

                    if (i > 0) {
                        inputValueArray[i] = '0';
                    }
                }
            }
        }

        // Reconstruct the string, converting any 10's to 0's
        inputValueArray = inputValueArray.slice(0, roundedStrLength + 1);

        // Return the rounded value
        inputValueRounded = this._truncateZeros(inputValueArray.join(''), temporaryDecimalPlacesOverride);

        return (Number(inputValueRounded) === 0) ? inputValueRounded : `${negativeSign}${inputValueRounded}`;
    }
Round the input value using the rounding method defined in the settings.
This function accepts multiple rounding methods. See the documentation for more details about those.

Note : This is handled as text since JavaScript math functions can return inaccurate values.

@param {string|null} inputValue An unformatted numeric value
@param {object} settings
@param {int} decimalPlacesToRoundTo
@returns {*}