@Nullable
    // method readability will not improve by splitting it up
    @SuppressWarnings("PMD.NPathComplexity")
    private Pair<Double, Boolean> evaluateNumber(final List<CharSequence> css, final Formula f, final Formula fAfterDigit, final Function<String, Value> varMap, final Predicate<Double> checker, final int precision) {
        final boolean hasDigits = fAfterDigit != null;
        final Value v = evaluateSingleFormula(f, varMap);
        final Value vAfter = !hasDigits ? null : evaluateSingleFormula(fAfterDigit, varMap);

        //check for diverse error situations
        if (v == null || !v.isDouble() ||
                (signum != 0 && v.isNumericNegative()) ||
                (hasDigits && (vAfter == null || !v.isLong() || !vAfter.isLong() || vAfter.isNumericNegative()))) {
            if (v == null) {
                add(css, f.evaluateToCharSequence(varMap));
            } else {
                addError(css, v.getAsString());
            }
            if (hasDigits) {
                add(css, ".");
                if (vAfter != null && vAfter.isInteger()) {
                    addError(css, padDigits(vAfter.getAsString(), precision).first);
                } else {
                    add(css, fAfterDigit.evaluateToCharSequence(varMap));
                }
            }
            return null;
        }

        if (hasDigits) {
            final String digits = v.getAsString();
            final Pair<CharSequence, Boolean> digitsAfter = padDigits(vAfter.getAsString(), precision);
            try {
                final double result = Double.parseDouble(digits + "." + digitsAfter.first);
                if (checker.test(result)) {
                    add(css, digits, ".", digitsAfter.first);
                    return new Pair<>(result, digitsAfter.second);
                } else {
                    addError(css, digits, ".", digitsAfter.first);
                    return new Pair<>(null, digitsAfter.second);
                }
            } catch (NumberFormatException nfe) {
                addError(css, digits, ".", digitsAfter.first);
                return new Pair<>(null, digitsAfter.second);
            }
        }

        if (checker.test(v.getAsDouble())) {
            add(css, v.getAsString());
            return new Pair<>(v.getAsDouble(), false);
        }
        addError(css, v.getAsString());
        return null;
    }
Evaluates both the double value and the CharSequence representation of this DegreeFormula
to allow for a more performant calculation.

@param varMap varmap to calculate values for
@return pair with calculated double value as first param (might be null) and text representation as secod (never null)
main/src/main/java/cgeo/geocaching/utils/formulas/DegreeFormula.java