function cleanPayment() {
var budget = sheet.getRange(1,6,1,1).getValue();
var cardsTotal = 0;
for (var i = 0; i < cards.length; i++) {
cardsTotal += Number(cards[i]);
var perCard = budget / cardsTotal;
var payments = [];
payments.push(cards[i] * perCard);
}
Logger.log(payments);
}
payments
应该包含一个数组,不是吗?但是Logger.log(payments)
会返回单个数字。 smb看错了吗?
提前谢谢。
答案 0 :(得分:1)
尝试在var payments = [];
循环
for