我试图弄清楚如何显示运送订单所需的每个盒子的最小数量。我已经完成了大部分工作,但似乎仍然无法完成程序。这是我到目前为止在 js 中的内容:
var calculate_boxes = function() {
var dvds = parseFloat($("dvds").value);
//Be sure the value entered is a positive number.
var cave = dvds / 24;
dvds = dvds % 24;
var bakers = dvds / 13;
dvds = dvds % 13;
var dimes = dvds / 10;
dvds = dvds % 10;
var quads = dvds / 10;
dvds = dvds % 10;
var twins = dvds / 4;
dvds = dvds % 4;
var minis = dvds / 1;
dvds = dvds % 1;
cave = parseInt($("cave").value);
bakers = parseInt($("bakers").value);
dimes = parseInt($("dimes").value);
quads = parseInt($("quads").value);
twins = parseInt($("twins").value);
minis = parseInt($("minis").value);
}