public static double toDoubleValue(Object value) {
        if (value == null) {
            return 0D;
        }

        if (value instanceof Double) {
            return (Double) value;
        }

        if (value instanceof Number) {
            return ((Number) value).doubleValue();
        }

        if (value instanceof String) {
            String str = (String) value;
            if (str.isEmpty() || "null".equals(str)) {
                return 0D;
            }
            return Double.parseDouble(str);
        }

        if ((value instanceof Collection && ((Collection<?>) value).isEmpty())
                || (value instanceof Map && ((Map<?, ?>) value).isEmpty())) {
            return 0;
        }

        if (value instanceof Collection && ((Collection<?>) value).size() == 1) {
            Object first = ((Collection<?>) value).iterator().next();
            if (first instanceof Number) {
                return ((Number) first).doubleValue();
            } else if (first instanceof String) {
                return Double.parseDouble((String) first);
            }
        }

        throw new JSONException("can not cast to double");
    }
decimal is integer, check has non-zero small

@param decimal
@return
core/src/main/java/com/alibaba/fastjson2/util/TypeUtils.java