|
@@ -6,18 +6,18 @@ const lightNightRate = +prompt('Введите стоимость кВт/час
|
|
|
|
|
|
const daysInMonth = +prompt('Кол-во дней в месяце:', 'дней')
|
|
|
|
|
|
-const priceDay = lightDayUse * lightDayRate
|
|
|
+const priceDay = +((lightDayUse * lightDayRate).toFixed(2))
|
|
|
const priceDayAlert = 'Стоимость потребленной электроэнергии в дневное время: ' + priceDay + ' грн.'
|
|
|
alert(priceDayAlert);
|
|
|
|
|
|
-const priceNight = lightNightUse * lightNightRate
|
|
|
+const priceNight = +((lightNightUse * lightNightRate).toFixed(2))
|
|
|
const priceNightAlert = 'Стоимость потребленной электроэнергии в ночное время: ' + priceNight + ' грн.'
|
|
|
alert(priceNightAlert);
|
|
|
|
|
|
-priceMonth = priceDay + priceNight
|
|
|
+priceMonth = (priceDay + priceNight).toFixed(2)
|
|
|
const priceMonthAlert = 'Стоимость потребленной электроэнергии в месяц: ' + priceMonth + ' грн.'
|
|
|
alert(priceMonthAlert);
|
|
|
|
|
|
-const usePerDay = (lightDayUse + lightNightUse) / daysInMonth
|
|
|
+const usePerDay = ((lightDayUse + lightNightUse) / daysInMonth).toFixed(2)
|
|
|
const usePerDayAlert = 'Среднее потребление в день: ' + usePerDay + ' кВт/ч.'
|
|
|
alert(usePerDayAlert);
|