• This project
    • Loading...
  • Sign in

fe / yohobuywap-node · Files

Go to a project

GitLab

  • Go to group
  • Project
  • Activity
  • Files
  • Commits
  • Pipelines 0
  • Builds 0
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Members
  • Labels
  • Wiki
  • Forks
  • Network
  • Create a new issue
  • yohobuywap-node
  • public
  • js
  • common
  • helpers
  • round.js
  • 列表模版 ok
    264b7339
    by 陈轩
    2017-01-05 13:31:17 +0800  
    Browse Directory »
round.js 246 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13
/**
 * 四舍五入
 * @param  {[type]} num 数字
 * @param  {[type]} precision 精度
 * @return {[type]}
 */
module.exports = (num, precision) => {
    precision = precision || 2;
    num = Number(num).toFixed(precision);

    return num;
};