第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Google App Script If Condition 沒有給出答案

Google App Script If Condition 沒有給出答案

鴻蒙傳說 2023-04-20 16:34:44
我試圖添加一個 if 條件。條件一如果預(yù)付款低于35%價格則"Your downpayment should be above 35% of the price"條件二如果預(yù)付款高于100%價格則"your downpayment should be below 100% of the price"條件三,如果首付款在 35%-100% 之間,則計算一下。答案在我下面的代碼中不起作用,我哪里出錯了? if(parseInt(downPayment) < 0.35*parseInt(vprice) || parseInt(downPayment) = parseInt(vprice)) {    document.getElementById("month").innerHTML = "Your downpayment should be minimum 35% of the price - "  +" (↑"+ nf.format((Math.round(vprice*0.35))) +")";    }      else if(parseInt(downPayment) > parseInt(vprice)) {    document.getElementById("month").innerHTML = "Your downpayment should be below 100% of the price - "  +" (↑"+ nf.format((Math.round(vprice*0.100))) +")";    }    else {    document.getElementById("month").innerHTML = " 1st Year Monthly Rental: "+ nf.format((Math.round(month))) + "<br>2nd Year Monthly Rental: " +  nf.format((Math.round(month2))) + "<br>3rd Year Monthly Retal:"+  nf.format((Math.round(month3))) ;  google.script.run.userClicked({    vprice,    downPayment,    rate,    period,    month  });  //sending to HTML by ID  document.getElementById("subL").innerHTML = "Sub Loan - "+  nf.format((Math.round(subL)));  document.getElementById("YearBulk1").innerHTML = "1st Year End Bulk Payment - "+ nf.format((Math.round(YearBulk1))); document.getElementById("YearBulk2").innerHTML = "2nd Year End Bulk Payment - "+ nf.format((Math.round(YearBulk2))); document.getElementById("YearBulk3").innerHTML = "3rd Year End Bulk Payment - "+ nf.format((Math.round(YearBulk3)));      }
查看完整描述

1 回答

?
瀟瀟雨雨

TA貢獻1833條經(jīng)驗 獲得超4個贊

解釋:

  • 你在第一個陳述中有一個錯字if;它應(yīng)該==代替=但你也可以通過使用簡化表達式<=

  • 您必須放在條件document.getElementById("month").innerHTML之外if,否則其余元素將不會發(fā)送到網(wǎng)頁。

  • 我還使用模板文字來簡化您的表達式并使其更適合未來。


解決方案:

if(parseInt(downPayment) <= 0.35*parseInt(vprice) ) {

? var resm = `Your downpayment should be minimum 35% of the price - (↑ ${nf.format((Math.round(vprice*0.35)))})`;

? }

??

??

? else if(parseInt(downPayment) > parseInt(vprice)) {

? ? var resm = `Your downpayment should be below 100% of the price - (↑ ${nf.format((Math.round(vprice*0.100)))})`;

? }

??

? else {

var resm = `1st Year Monthly Rental: ${nf.format((Math.round(month)))} <br>2nd Year Monthly Rental: ${nf.format((Math.round(month2)))} <br>3rd Year Monthly Retal: ${nf.format((Math.round(month3)))}`;

? }



? document.getElementById("month").innerHTML = resm;

? google.script.run.userClicked({

? ? vprice,

? ? downPayment,

? ? rate,

? ? period,

? ? month

? })


? //sending to HTML by ID

? document.getElementById("subL").innerHTML = "Sub Loan - "+? nf.format((Math.round(subL)));

? document.getElementById("YearBulk1").innerHTML = "1st Year End Bulk Payment - "+ nf.format((Math.round(YearBulk1)));

?document.getElementById("YearBulk2").innerHTML = "2nd Year End Bulk Payment - "+ nf.format((Math.round(YearBulk2)));

?document.getElementById("YearBulk3").innerHTML = "3rd Year End Bulk Payment - "+ nf.format((Math.round(YearBulk3)));



查看完整回答
反對 回復(fù) 2023-04-20
  • 1 回答
  • 0 關(guān)注
  • 103 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號