feat:当传的值是null 时 不显示

This commit is contained in:
zhangyu
2020-09-29 14:05:18 +08:00
parent e6321f464a
commit 520c020df9
2 changed files with 4 additions and 1 deletions

View File

@@ -323,6 +323,9 @@ function days(value,index,type=1,dot){
* dot保留的小数位 * dot保留的小数位
* */ * */
function asciiCompute(num,ascii,units,dot=2){ function asciiCompute(num,ascii,units,dot=2){
if(!num && num!==0 && num!=='0'){
return ''
}
num=Number(num) num=Number(num)
let carry=0; let carry=0;
if(num > 1){ if(num > 1){

View File

@@ -619,7 +619,7 @@
+ [t_date.getHours(), t_date.getMinutes(),t_date.getSeconds()].join(':'); + [t_date.getHours(), t_date.getMinutes(),t_date.getSeconds()].join(':');
str +=`<br/>`; str +=`<br/>`;
} }
let val = parseFloat(Number(item.data[1]).toFixed(2)); let val =item.data[1]?parseFloat(Number(item.data[1]).toFixed(2)):'';
if(val===0){ if(val===0){
val = Number(item.data[1]); val = Number(item.data[1]);
} }