export default {
  computed: {
    formatterNum() {
      return val => (!val ? '0' : parseInt(val).toLocaleString());
    },
    formatterToFixed() {
      return val => (!val ? '0.00' : parseFloat(val).toFixed(2));
    },
    formatterRate() {
      return val => (!val ? '0.00%' : parseFloat(val).toFixed(2) + '%');
    },
    formatterNumAndFixed() {
      return val => parseFloat(val || 0).toLocaleString('zh', { minimumFractionDigits: 2 });
    }
  }
};
