js计算单词价格
499以下 价格是569.85
500-999 价格是884.25
1000-1499 价格是1198.65
以此类推
封顶是40000字,超过4万个单词就不用计算价格了,4万以内输入任意单词个数返回相应的价格
js计算单词价格
499以下 价格是569.85
500-999 价格是884.25
1000-1499 价格是1198.65
以此类推
封顶是40000字,超过4万个单词就不用计算价格了,4万以内输入任意单词个数返回相应的价格
function getPrice (num) {
if (num > 40000) return 999999999
return parseInt(num / 500) * 314.4 + 569.85
}
console.log('0==', getPrice(0))
console.log('400==', getPrice(400))
console.log('499==', getPrice(499))
console.log('500==', getPrice(500))
console.log('600==', getPrice(600))
console.log('999==', getPrice(999))
console.log('1000==', getPrice(1000))
console.log('1200==', getPrice(1200))
console.log('1499==', getPrice(1499))