public static String toDecimalForm(String value) {
        if (value.startsWith("%B"))
            value = String.valueOf(binaryToInt(value.substring(2)));
        else if (value.startsWith("%X")) {
            if (value.length() == 6)
                value = String.valueOf(hex4ToInt(value.substring(2)));
            else
                value = String.valueOf(hexToInt(value.substring(2)));
        }
        else if (value.startsWith("%D"))
            value = value.substring(2);
        else {
            try {
                int intValue = Integer.parseInt(value);
                value = String.valueOf(intValue);
            } catch (NumberFormatException nfe) {
            }
        }

        return value;
    }