fhx
2023-11-16 d182dc7cd0ebd4b8dc4a8048e79a629209d2bf43
src/main/java/com/hx/util/MapUtil.java
@@ -74,4 +74,20 @@
        return null == map.get(key) ? BigDecimal.ZERO : new BigDecimal(map.get(key).toString());
    }
    /**
     * 获取浮点数,默认返回0
     * @param map
     * @param key
     * @return
     */
    public static Double getDoubleZero(Map<String, Object> map, String key)
    {
        if(map == null || StringUtils.isEmpty(key))
        {
            return 0D;
        }
        return null == map.get(key) ? 0D : Double.parseDouble(map.get(key).toString());
    }
}