fix:修改chart Y轴为时间时的精度问题

This commit is contained in:
zhangyu
2020-10-15 17:13:38 +08:00
parent d90c62380d
commit 723c2653ae

View File

@@ -372,6 +372,9 @@ function asciiCompute2(num,ascii,units,dot=2,unitIndex=0){
* unit:设置的单位 * unit:设置的单位
* */ * */
function timeCompute(value,unit,dot=0){ function timeCompute(value,unit,dot=0){
if(Number.isInteger(value)) {
dot=0;
}
if(unit == 'year'){ if(unit == 'year'){
return `${value.toFixed(dot)} ${unit}`; return `${value.toFixed(dot)} ${unit}`;
} }