I have my collection as
Student
{
\"first_name\":\"Harew\",
\"last_name\":\"Jackson\",
\"class\":14,
\"fee\": [
you can easily round up the values into specific precision from BigDecimal , also if you want you can convert it into double value at the same time . For Example : -
scala> val s :BigDecimal = 10.232 s: BigDecimal = 10.232
scala> s.setScale(2, BigDecimal.RoundingMode.HALF_UP).toDouble res1: Double = 10.23 // CONVERTED AS DOUBLE
scala> s.setScale(2, BigDecimal.RoundingMode.HALF_UP) res2: scala.math.BigDecimal = 10.23 // Rouding Off
So in scala instead of using math.Round you can use setScale.