// пересчитываем %
p1Input.value = p1Cell.dataset.offline > 0
- ? (100 * offlineVal / +p1Cell.dataset.offline).toFixed(2)
+ ? (100 * offlineVal / +p1Cell.dataset.offline)
: 0;
p2Input.value = p2Cell.dataset.online > 0
- ? (100 * internetVal / +p2Cell.dataset.online).toFixed(2)
+ ? (100 * internetVal / +p2Cell.dataset.online)
: 0;
p3Input.value = p3Cell.dataset.writeoffs > 0
- ? (100 * writeoffsVal / +p3Cell.dataset.writeoffs).toFixed(2)
+ ? (100 * writeoffsVal / +p3Cell.dataset.writeoffs)
: 0;
// сохраняем на сервере
switch (num) {
case 1: {
const pct = +p1Cell.querySelector('input').value;
- const newVal = (pct / 100 * +p1Cell.dataset.offline).toFixed(2);
+ const newVal = (pct / 100 * +p1Cell.dataset.offline);
tr.querySelector(`td[data-offline-type="${type}"] input[name="offline"]`).value = newVal;
break;
}
case 2: {
const pct = +p2Cell.querySelector('input').value;
- const newVal = (pct / 100 * +p2Cell.dataset.online).toFixed(2);
+ const newVal = (pct / 100 * +p2Cell.dataset.online);
tr.querySelector(`td[data-online-type="${type}"] input[name="internet_shop"]`).value = newVal;
break;
}
case 3: {
const pct = +p3Cell.querySelector('input').value;
- const newVal = (pct / 100 * +p3Cell.dataset.writeoffs).toFixed(2);
+ const newVal = (pct / 100 * +p3Cell.dataset.writeoffs);
tr.querySelector(`td[data-writeoffs-type="${type}"] input[name="write_offs"]`).value = newVal;
break;
}