wxs Number对象不存在?

发布于 6 年前作者 leiyuan18971 次浏览最后编辑 6 年前来自 ask

<wxs module=‘formatMoney’>

function getInt(a) {

return Number.parseInt(a)

}

module.exports={

getInt:getInt

}

</wxs>

错误提示:

Number.parseInt is not a function

TypeError: Number.parseInt is not a function

2 回复
litao
litao1 楼6 年前

小程序基础类库只包含了Number的属性,而parseInt方法直接用就好

gongwei
gongwei2 楼5 年前

谢谢 哪里知道基础类库只包含了Number的属性的?