wxs 中 toLocaleString 无效
发布于 4 年前 作者 yangzhang 755 次浏览 来自 问答
module.exports = {
  currency: function (money) {
    var money = money.toLocaleString('zh-CN', {
      style: 'currency',
      currency: 'CNY'
    });
    return money;
  }
}

在 wxs 中 使用 toLocaleString 并没有按照预期进行格式化,而我看文档中 wxs 是支持 toLocaleString 方法的

2 回复

toLocaleString方法是支持的,只是不支持代码中对应的locales/options参数。

回到顶部