{"size": 455, "ext": "js", "max_stars_repo_path": "src/plugins/filter.js", "max_stars_repo_name": "sigmaol/imooc-microservice", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/plugins/filter.js", "max_issues_repo_name": "sigmaol/imooc-microservice", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/plugins/filter.js", "max_forks_repo_name": "sigmaol/imooc-microservice", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 15.1666666667, "max_line_length": 53, "alphanum_fraction": 0.6021978022}
import moment from 'moment'

const formatDataTime = time => {
  if (time) {
    return moment(time).format('YYYY-MM-DD HH:mm:ss')
  } else {
    return ''
  }
}

const formatGender = gender => {
  if (gender === 0) {
    return '女'
  } else if (gender === 1) {
    return '男'
  } else {
    return ''
  }
}

const formatBalance = balance => {
  return parseFloat(balance).toFixed(2)
}

export default {
  formatDataTime,
  formatGender,
  formatBalance
}
