How to use the numeral._ function in numeral

To help you get started, we’ve selected a few numeral examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vueblocks / ve-charts / src / utils / formatZhNumber.js View on Github external
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: '万' },
github vueblocks / ve-charts / src / utils / formatZhNumber.js View on Github external
unformat: function (string) {
    return numeral._.stringToNumber(string) * 0.01;
  }
});