Merge branch 'dev-3.6' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.7
This commit is contained in:
@@ -10,6 +10,9 @@ function none (value, index) {
|
||||
if (!numberWithEConvent(scientificNotationValue)) {
|
||||
return scientificNotationValue
|
||||
}
|
||||
if (isNaN(value) || value=== null) {
|
||||
return value
|
||||
}
|
||||
return keepDoubleNumber(value)
|
||||
}
|
||||
function short (value, index, type = 1, dot) {
|
||||
@@ -327,6 +330,9 @@ function numberWithEConvent (num) {
|
||||
return num
|
||||
}
|
||||
}
|
||||
if (isNaN(num) || num === null) {
|
||||
return num
|
||||
}
|
||||
return 0
|
||||
}
|
||||
/*
|
||||
@@ -337,6 +343,9 @@ function numberWithEConvent (num) {
|
||||
* dot:保留的小数位,
|
||||
* */
|
||||
function asciiCompute (num, ascii, units, dot = 2) {
|
||||
if (isNaN(num) || num === null) {
|
||||
return num
|
||||
}
|
||||
const scientificNotationValue = formatScientificNotation(num, dot)
|
||||
if (!numberWithEConvent(scientificNotationValue)) {
|
||||
return scientificNotationValue
|
||||
@@ -443,6 +452,9 @@ function timeCompute (value, unit, dot = 0) {
|
||||
}
|
||||
// 保留两位有效数字
|
||||
function keepDoubleNumber (num) {
|
||||
if (num === null) {
|
||||
return num
|
||||
}
|
||||
const decimal = num.toString()
|
||||
let returnNum = ''
|
||||
if (num == 0) {
|
||||
|
||||
Reference in New Issue
Block a user