为什么零格式化在格式化结果中包含$和%符号?numeral.js版本为1.5.3
var number = numeral(0);
numeral.zeroFormat('N/A');
var zero = number.format('0.0%')
// 'N/A%'
var zero = number.format('$0.0')
// '$N/A'
// What I expect is 'N/A'是bug,还是我漏掉了什么?
发布于 2017-01-13 23:24:28
快速找到解决方案。这个问题发生在旧版本中。只需移动到最新版本:
var number = numeral(0);
numeral.zeroFormat('N/A');
var zero = number.format('0.0%')
// 'N/A'https://stackoverflow.com/questions/41637780
复制相似问题