function numberConversion(value) {
const newValue = ['', '', '']
let fr = 1000
let num = 3
let txt = ''
let fm = 1
while (value / fr >= 1) {
fr *= 10
num += 1
}
if (num <= 4) { // 千
newValue[0] = parseInt(value) + ''
newValue[1] = ''
} else if (num <= 8) { // 万
text1 = parseInt(num - 4) / 3 > 1 ? '千万' : '万'
fm = txt === '万' ? 10000 : 10000000
if (value % fm === 0) {
newValue[0] = parseInt(value / fm) + ''
} else {
newValue[0] = parseFloat(value / fm).toFixed(1) + ''
}
newValue[1] = text1
} else if (num <= 16) { // 亿
txt = (num - 8) / 3 > 1 ? '千亿' : '亿'
txt = (num - 8) / 4 > 1 ? '万亿' : txt
txt = (num - 8) / 7 > 1 ? '千万亿' : txt
fm = 1
if (txt === '亿') {
fm = 100000000
} else if (txt === '千亿') {
fm = 100000000000
} else if (txt === '万亿') {
fm = 1000000000000
} else if (txt === '千万亿') {
fm = 1000000000000000
}
if (value % fm === 0) {
newValue[0] = parseInt(value / fm) + ''
} else {
newValue[0] = parseFloat(value / fm).toFixed(1) + ''
}
newValue[1] = txt
}
if (value < 1000) {
newValue[0] = value + ''
newValue[1] = ''
}
return newValue.join('')
}