Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
format: function (value, format, roundingFunction) {
// 判断是否有空格
const space = numeral._.includes(format, ' zh') ? ' ' : ''
// match 数据格式
const precision = format.match(/\d.\d+/)
let digits
if (precision) {
// 确定小数点后几位小数
digits = precision[0].split('.')[1].length
}
// check for space before zh
format = format.replace(/\s?\zh/, '');
const cnNumberFormat = (val, digits = 0) => {
if (isNaN(+val)) return val
let symbolMap = [
{ value: 1E8, symbol: '亿' },
{ value: 1E4, symbol: '万' },
unformat: function (string) {
return numeral._.stringToNumber(string) * 0.01;
}
});