添加了供应商列表和搜索物品分页功能
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user