Take a look for this method, in my case it works:
fun Double.roundTo(numFractionDigits: Int): Double {
val factor = 10.0.pow(numFractionDigits.toDouble())
return (this * factor).roundToInt() / factor
}
i borrow this from: java - Round Double to 1 decimal place kotlin: from 0.044999 to 0.1 - Stack Overflow