添加了供应商列表和搜索物品分页功能

This commit is contained in:
zxj
2025-07-11 15:53:17 +08:00
parent 7459bd205a
commit f1283ba11e
8 changed files with 182 additions and 19 deletions
@@ -3,6 +3,7 @@ package com.sw.inbound.ext
import java.math.BigDecimal
import java.math.RoundingMode
import kotlin.math.pow
import kotlin.math.round
fun Float.toFormattedString(decimalPlaces: Int = 2): String {
return when (this) {
@@ -32,12 +33,12 @@ fun Double.toSafeBigDecimal(): BigDecimal {
*/
private fun Double.roundToDouble(decimalPlaces: Int): Double {
val factor = 10.0.pow(decimalPlaces)
return kotlin.math.round(this * factor) / factor
return round(this * factor) / factor
}
private fun Float.roundToDouble(decimalPlaces: Int): Double {
val factor = 10.0.pow(decimalPlaces)
return kotlin.math.round(this * factor) / factor
return round(this * factor) / factor
}
fun Float?.toSafeString(unitName: String?): String {
@@ -101,4 +102,4 @@ fun BigDecimal.toFormattedString(): String {
fun Int.toFormattedString(): String {
return this.toString()
}
}