Commit 1b60fe7e authored by JingChao's avatar JingChao

Update filter.js

parent 15cc4932
...@@ -2,7 +2,7 @@ export default (Vue) => { ...@@ -2,7 +2,7 @@ export default (Vue) => {
Vue.filter('currency', function (val) { Vue.filter('currency', function (val) {
if (!val) return '0.00' if (!val) return '0.00'
var intPart = Number(val).toFixed(0) // 获取整数部分 var intPart = parseInt(Number(val)) // 获取整数部分
var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断 var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
var floatPart = '.00' // 预定义小数部分 var floatPart = '.00' // 预定义小数部分
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment