Calculate problem.
#1

How could I do that every 500 km traveled by vehicle to increase the price of insurance for 100$?
Exemple:
KM < 500 = 100$ Insurance Price.
500 KM = 200$ Insurance Price.
1.000 KM = 300$ Insurance Price.
1.500 KM = 400$ Insurance Price.
...and so on...
Reply
#2

Код:
price = ((distance / 500) + 1) * 100;
Basic math, really.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
Код:
price = ((distance / 500) + 1) * 100;
Basic math, really.
Thank you man, thank you.
KM is a float variable, exemple: MYSQL TABLE: "3.8".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)