BigDecimal 与 int 的区别?
我有两个号码,1.4350
和 1.4300
。当我减去它们时,我希望得到 50
,而不是返回 0.0050
。它还需要与 90.25
和 90.10
配合使用,返回 15
。
I have two numbers, 1.4350
and 1.4300
. When I subtract them, instead of returning 0.0050
, I'm looking to get 50
. It also needs to work with 90.25
and 90.10
, returning 15
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
BigDecimal.unscaledValue()
。这将返回您想要的 BigInteger。You can use
BigDecimal.unscaledValue()
. This will return what you want as a BigInteger.