数组随机
const provinceArr = ["北京市","天津市","河北省","山西省","辽宁省","吉林省","黑龙江省","上海市","江苏省","浙江省","安徽省","福建省","江西省","山东省","河南省","湖北省","湖南省","广东省","海南省","重庆市","四川省","贵州省","云南省","陕西省","甘肃省","青海省"]; var provinceArr= provinceArr[Math.floor(Math.random()*provinceArr.length)]; const text = '欢迎来自'+this.provinceArr+'的朋友'; console.log(text )
js 保留两位小数(整数不补零)
parseFloat((this.old_price*1-this.price*1).toFixed(2))