如何将bigdecimal转换为int

如题所述

BigDecimal a=new BigDecimal(12.88);
int b=a.intValue();
System.out.println(b);//b=12;
温馨提示:答案为网友推荐,仅供参考
相似回答
大家正在搜