
export default {
  toFixed(val,number = 2) {
    if(val) {
      return val.toFixed(number)
    } else {
      return '0.00'
    }
    
  },

  countdown(second) {
    if (second) {
      let h = parseInt((second / 60 / 60) % 24); //   计算小时
      let m = parseInt((second / 60) % 60); //   计算分数
      let s = parseInt(second % 60); //   计算当前秒数

      if (h < 10) h = '0' + h;
      if (m < 10) m = '0' + m;
      if (s < 10) s = '0' + s;

      return h + ':' + m + ':' + s;
    } else {
      return '';
    }
  },
}