var sub = function(val) { if (val.length == 0 || val == undefined) { return; } if (val.length > 17) { return val.substring(0, 17) + "..."; } else { return val.substring(0, 1); } } var filters = { toFloat: function (value) { return parseFloat(value) }, toStr: function (value) { return value.toString() }, toNum: function (value) { return value.toNumber() }, } var spl = function(str){ return str.split(","); } module.exports = { toFloat: filters.toFloat, toStr: filters.toStr, toNum: filters.toNum,//暴露接口调用 sub: sub, spl: spl };