index.wxs 453 Bytes
/**
 * @file 首页/建单录单弹窗 wxs(金额分转元)
 * 用法:<wxs src="/tabIndex/components/recordingOrderPopup/index.wxs" module="filter" />
 *
 * @param {number} num 金额(分)
 * @returns {string} 元,保留两位小数
 */
var priceFilter = function (num) {
  // 处理金额分转元并补零
  var pow = Math.pow(10, 2)
  return (Math.round(num / 100 * pow) / pow).toFixed(2)
}
module.exports = {
  priceFilter: priceFilter
}