Hubert-Dudek
Databricks MVP

Output is rather correct as this is as percentage are in excel (what is seen in excel is just formatting of cells). In Spark the same 100% = 1.

If you want to display as percentage for example in dashboard you just need to concatenate % sign.

.withColumn("rate",(col("rate") * 100).cast("int"))
.withColumn("rate",concat((col("rate") * 100).cast("int"),lit('%')))


My blog: https://databrickster.medium.com/