1、直接通过String的format格式化
val formatString = "%.2f"
2、通过DecimalFormat格式化
val decimal = DecimalFormat("#.##")
decimal.format(processingFeePer)
3、通过NumberFormat
val numberFormat = NumberFormat.getInstance().apply {
maximumFractionDigits = 2
roundingMode = RoundingMode.UNNECESSARY
}
val format = numberFormat.format(processingFee)