fixedValue(value) {
let floatValue = value?parseFloat(value) :0
floatValue = Math.floor(floatValue*10)/10
let result = floatValue.toString()
let integerLength = result.indexOf('.')
if (integerLength < 0) {
integerLength = result.length
result += '.'
}
if (result.length <= integerLength + 1) {
result += '0'
}
return result
}
向下取整强制保留一位小数
于 2023-03-10 10:47:09 首次发布