I have a script for taxi fare calculator. It calculates the cost of a destination from one end to the other. The problem is that I do not know how to change the cost per km (km).
What do I need that is 1.95 EUR per km. And the 40 km above 1.65 Euros count for the Google Maps destination.
Here is the code:
if (10> total) {var cost = & lt ;? Php echo $ fix; ? & Gt ;; } And if (10 & lt; Total & amp; amp; 20> Total) {var cost = ((total * & lt ;? php echo $ rate;? & Gt;) + (& lt ;? php $ Extras;; & gt;);} And if (20 30 & gt; total) {var cost = ((total * & lt ;? php echo $ rate ;; & gt;) + ( & Lt ;? php $ next;; & gt;);} and if (30 & lt; total & amp; 50x; total) {var cost = (((- 30) * & lt ;? php echo $ Cons ;? & gt;) + (& lt ;? php $ echo up;; & gt;));} other {var cost = (((total - 50) * Can someone help me? < / P>
Try it: -
D (total <40) {var cost = parseInt (total) * 1.95;} other {var cost = parseInt (total) * 1.65;}
No comments:
Post a Comment