function calcHourlyRoom() { var type = document.getElementById('roomType').value; var hours = Number(document.getElementById('roomHours').value); var day = document.getElementById('roomDay').value; var air = document.getElementById('roomAircon').value; var profit = Number(document.getElementById('roomProfit').value); // 1時間あたり料金 var hourlyFee = 0; if (type === 'rehearsal') hourlyFee = 1830; if (type === 'practice1') hourlyFee = 300; if (type === 'practice2') hourlyFee = 210; if (type === 'practice3') hourlyFee = 400; if (type === 'exhibition') hourlyFee = 950; if (type === 'training1') hourlyFee = 460; if (type === 'training2') hourlyFee = 700; if (type === 'avroom') hourlyFee = 460; if (type === 'japaneseroom') hourlyFee = 310; if (type === 'meeting') hourlyFee = 810; if (type === 'specialmeeting') hourlyFee = 1570; // 基本料金(時間数を掛ける) var base = hourlyFee * hours; // 土日祝 2割増 var addHoliday = (day === 'holiday') ? Math.round(base * 0.2) : 0; // 空調 5割増 var addAircon = (air === 'yes') ? Math.round(base * 0.5) : 0; // 営利割増(基本料金から) var addProfit = Math.round(base * profit); var finalFee = base + addHoliday + addAircon + addProfit; // 最終結果だけ10円単位で切り捨て finalFee = Math.floor(finalFee / 10) * 10; document.getElementById('roomResult').innerText = finalFee.toLocaleString(); }