首页 > 编程知识 正文

bigdecimal转为int,int to string

时间:2023-05-06 00:34:02 阅读:39679 作者:614

这里得到的是BigDecimal类型的数据,

1.BigDecimal类型转换为String类型的数据//其中,在名为industryUseRecordEntity的对象中,存储在属性//SumSourceNum中的数据为BigDecimal类型的数据

//%0.f表示小数点后0位的value list.add (string.format (' %.0f ',industryuserecordentity.getsumsourcenum ) )。 2.1 .从BigDecimal类型转换为Int类型的数据必须使用Integer.parseInt (),但此方法必须包含String类型,因此必须将BigDecimal类型转换为我的String类型

//%0.f小数点后0位的value list.add (integer.parseint (string.format (' %.0f ),industryuserecordentity.getsumsourcourcon

现在可以转换为字符串类型

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。