Calcula la ganancia
Dado un arreglo asociativo que contiene cost_price, sell_price y inventory, devuelve la ganancia total después de vender todo el inventario, redondeada al dólar más cercano.
profit = (sell price - cost price) * inventory
Ejemplos
profit(["cost_price" => 32.67, "sell_price" => 45.00, "inventory" => 1200]) ➞ 14796
profit(["cost_price" => 225.89, "sell_price" => 550.00, "inventory" => 100]) ➞ 32411
profit(["cost_price" => 2.77, "sell_price" => 7.95, "inventory" => 8500]) ➞ 44030Notas
Supón que se ha vendido todo el inventario.