Вы можете разыграть, используя DecimalType (3,2), импортировав org.apache.spark.sql.types ._
scala> val df = Seq(
| (1, 1.000234, 2.3456, 4.6789, 7.6934),
| (2, 3.7643, 4.2323, 5.6342, 8.567)
| ).toDF("id", "A", "B", "C", "D")
df: org.apache.spark.sql.DataFrame = [id: int, A: double ... 3 more fields]
scala> df.show()
+---+--------+------+------+------+
| id| A| B| C| D|
+---+--------+------+------+------+
| 1|1.000234|2.3456|4.6789|7.6934|
| 2| 3.7643|4.2323|5.6342| 8.567|
+---+--------+------+------+------+
scala> import org.apache.spark.sql.types._
import org.apache.spark.sql.types._
scala> val df2=df.columns.filter(_ !="id").foldLeft(df){ (acc,x) => acc.withColumn(x,col(x).cast(DecimalType(3,2))) }
df2: org.apache.spark.sql.DataFrame = [id: int, A: decimal(3,2) ... 3 more fields]
scala> df2.show(false)
+---+----+----+----+----+
|id |A |B |C |D |
+---+----+----+----+----+
|1 |1.00|2.35|4.68|7.69|
|2 |3.76|4.23|5.63|8.57|
+---+----+----+----+----+
scala>