Widget:PriceCalculator: Difference between revisions
Jump to navigation
Jump to search
(perfection) |
(truncate numbers, add tablestyle) |
||
Line 60: | Line 60: | ||
let price_mod = Math.max(1.0, 2.5 - persuasion_mod - attitude - difficulty); | let price_mod = Math.max(1.0, 2.5 - persuasion_mod - attitude - difficulty); | ||
let price_buy = item_value * price_mod; | let price_buy = Math.floor(item_value * price_mod); | ||
let price_sell = item_value / price_mod; | let price_sell = Math.floor(item_value / price_mod); | ||
output.textContent = ''; | output.textContent = ''; | ||
let table = document.createElement('table'); | let table = document.createElement('table'); | ||
table.classList.add('wikitable'); | |||
table.appendChild(create_output_row('Base item price', item_value)); | table.appendChild(create_output_row('Base item price', item_value)); | ||
table.appendChild(create_output_row('Item price when selling to a trader', price_sell)); | table.appendChild(create_output_row('Item price when selling to a trader', price_sell)); |