Convert scala.math.BigDecimal to java.math.BigDecimal?

南笙酒味 提交于 2019-12-03 16:22:26

问题


How do I convert a scala.math.BigDecimal to java.math.BigDecimal?


回答1:


No need to double-convert to and from string.

val sb = scala.math.BigDecimal(12345)
val jb = sb.bigDecimal

scala.math.BigDecimal is just a very simple wrapper around java.math.BigDecimal, and it provides wrapped value as one of fields.



来源:https://stackoverflow.com/questions/22475082/convert-scala-math-bigdecimal-to-java-math-bigdecimal

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!