Ad
Mathematics
Algorithms
Logic
Numbers

You must calculate the virtual cost of an item based on the real cost of the item to the rounded $token.

price = 19.99, token = 5 the token cost should output 20, Tokens can never cost 0 unless token cost and price is 0.

calcTokenCost(19.99, 5) = 20

calcTokenCost(17.30, 5) = 15

calcTokenCost(0.01, 5) = 5

calcTokenCost(0, 5) = 5

calcTokenCost(0, 0) = 0

function calcTokenCost($price, $token) {
  

}