java从Object类型转换成double类型

  • Post author:
  • Post category:java


java从Object类型转换为double类型:

Map<String,Object> map = new HashMap<String,Object>();
map.put("order",1.245);
BigDecimal order = (BigDecimal)map.get("order");
double d = (order==null?0:order.doubleValue());

转载于:https://www.cnblogs.com/shuilangyizu/p/7744522.html