function formatNumber(n) {
  n = n.toString()
  return n[1] ? n : '0' + n
}

function toFixed(number) {
  if (number) {
    return Number(number).toFixed(2)
  }
  return '0.00'
}

// 时间戳转成年月日时分秒
function formateHS(date) {
  if (date.replace) {
    date = date.replace(getRegExp('-', 'g'), '/');
  }
  date = getDate(date)
  var hour = date.getHours()
  var min = date.getMinutes()
  return [hour, min].map(formatNumber).join(':');
}
module.exports = {
  toFixed: toFixed,
  formateHS: formateHS
};