public float getFloatValue(String key) {
        Object value = super.get(key);

        if (value == null) {
            return 0F;
        }

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

        if (value instanceof String) {
            String str = (String) value;

            if (str.isEmpty() || "null".equalsIgnoreCase(str)) {
                return 0F;
            }

            return Float.parseFloat(str);
        }

        throw new JSONException("Can not cast '" + value.getClass() + "' to float value");
    }
Returns a float value of the associated keys in this {@link JSONObject}.

@param key the key whose associated value is to be returned
@return float
@throws NumberFormatException If the value of get is {@link String} and it contains no parsable float
@throws JSONException Unsupported type conversion to float value
core/src/main/java/com/alibaba/fastjson2/JSONObject.java