function price0301(amount) { var res = 0; if (amount > 1000) { res = amount * 2 + 4040;} else if (amount > 199) { res = amount * 5 + 1040;} else if (amount > 100) { res = amount * 7.5 + 540.5;} else if (amount > 20) { res = amount * 10 + 290;} else if (amount > 10) { res = amount * 15 + 190;} else if (amount > 2) { res = amount * 30 + 40;} else if (amount > 0) { res = amount * 50 + 0;} return res; } function price0310(amount) { var res = (amount * 5); return res; }