mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 11:32:57 +08:00
Merge pull request #13703 from dataease/pr@dev-v2@chart-transDecimal-fix
fix(图表): 修复数值格式后的值出现-0或者-0.00(即负零)的问题,将视为0或者0.00 #13222
This commit is contained in:
commit
ed6a8d1e4d
@ -51,7 +51,11 @@ function transUnit(value, formatter) {
|
||||
}
|
||||
|
||||
function transDecimal(value, formatter) {
|
||||
return value.toFixed(formatter.decimalCount)
|
||||
const resultV = value.toFixed(formatter.decimalCount)
|
||||
if (Object.is(parseFloat(resultV), -0)) {
|
||||
return resultV.slice(1)
|
||||
}
|
||||
return resultV
|
||||
}
|
||||
|
||||
function transSeparatorAndSuffix(value, formatter) {
|
||||
|
Loading…
Reference in New Issue
Block a user