重量显示优化

This commit is contained in:
2025-10-10 17:59:47 +08:00
parent 6387d9a776
commit 3d28c5692a
2 changed files with 7 additions and 3 deletions
@@ -175,7 +175,9 @@ fun View.clickWithDebounce(delay: Long = 300, action: () -> Unit) {
}
}
}
fun Double.roundedDecimalPlace(num: Int): Double {
return BigDecimal(this).setScale(num, RoundingMode.HALF_UP).toDouble()
}
fun Double.roundedOneDecimalPlace(): Double {
return BigDecimal(this).setScale(1, RoundingMode.HALF_UP).toDouble()
return this.roundedDecimalPlace(1)
}