<div>
<span class="num purple">{{productInfo.balance | formatnum}}</span>
<span class="unit purple">元</span>
</div>
filters: {
formatnum(num) {
var result = '', counter = 0;
num = Number((num || 0)).toString();
for (var i = num.length - 1; i >= 0; i--) {
counter++;
result = num.charAt(i) + result;
if (!(counter % 3) && i != 0) { result = ',' + result; }
}
return result;
}
},