Yeah, cargo computations are full of bugs, I find. Without going much further, the use of floating point numbers is incorrect. It should be using integers, as the numbers of any item are naturally integers, unless they are planning to allow you to buy fractional amounts of say tons of wheat, or...