💰 Financial

VGPC Lot Calculator

VGPC Lot Calculator

Use our VGPC Lot Calculator to quickly estimate the total value of your video game lot. Enter game titles, platforms, and conditions to receive a detailed price breakdown with real-time updates across any device.

vgpc-ref

VGPC Lot Calculator

TitlePlatformConditionPrice
'); w.document.close(); w.focus(); setTimeout(function(){ w.print(); }, 300); });// Render table function renderTable(){ resultBody.innerHTML = ''; resultFoot.innerHTML = ''; let total = 0; games.forEach(function(g, idx){ const tr = document.createElement('tr');const tdTitle = document.createElement('td'); tdTitle.innerText = g.title; tr.appendChild(tdTitle); const tdPlat = document.createElement('td'); tdPlat.innerText = g.platformLabel || g.platform; tr.appendChild(tdPlat); const tdCond = document.createElement('td'); tdCond.innerText = g.condition; tr.appendChild(tdCond);const tdPrice = document.createElement('td'); tdPrice.className = 'vg-price'; tdPrice.innerHTML = ('$' + Number(g.price).toFixed(2)) + ' ' + ' '; tr.appendChild(tdPrice);resultBody.appendChild(tr); total += Number(g.price) || 0; });const trFoot = document.createElement('tr'); trFoot.style.borderTop = '2px solid #e6eefc'; const tdLabel = document.createElement('td'); tdLabel.colSpan = 3; tdLabel.className = 'vg-total-label'; tdLabel.innerText = 'Total Value'; trFoot.appendChild(tdLabel); const tdValue = document.createElement('td'); tdValue.className = 'vg-total-value'; tdValue.innerText = '$' + Number(total).toFixed(2); trFoot.appendChild(tdValue); resultFoot.appendChild(trFoot);// wire up edit/remove Array.from(document.getElementsByClassName('vg-edit-complete')).forEach(function(btn){ btn.addEventListener('click', function(){ const idx = Number(btn.getAttribute('data-idx')); const current = games[idx]; const newVal = prompt('Edit price for "'+current.title+'" (in USD):', String(current.price)); if(newVal === null) return; const v = parseFloat(newVal); if(Number.isFinite(v) && v >= 0){ games[idx].price = v; renderTable(); } else { alert('Please enter a valid non-negative number for price.'); } }); }); Array.from(document.getElementsByClassName('vg-remove-complete')).forEach(function(btn){ btn.addEventListener('click', function(){ const idx = Number(btn.getAttribute('data-idx')); if(!confirm('Remove "' + games[idx].title + '" from the lot?')) return; games.splice(idx,1); renderTable(); }); }); }// Suggestion logic (uses localIndex and heuristics) function getSuggestedPrice(title, platform, condition){ const nt = normalize(title); if(localIndex[nt] && localIndex[nt].prices && typeof localIndex[nt].prices[condition] === 'number') { return localIndex[nt].prices[condition]; } // partial match token search const tokens = nt.split(/\s+/).filter(Boolean); for(const key in localIndex){ const matches = tokens.every(t => key.includes(t)); if(matches){ const rec = localIndex[key]; if(rec.prices && typeof rec.prices[condition] === 'number') return rec.prices[condition]; if(rec.prices) return Object.values(rec.prices)[0]; } } // platform heuristics fallback const heur = { 'N64': { Loose: 20, CIB: 100, New: 250 }, 'GAMEBOY': { Loose: 15, CIB: 80, New: 300 }, 'SNES': { Loose: 25, CIB: 90, New: 300 }, 'NES': { Loose: 20, CIB: 80, New: 250 }, 'SWITCH': { Loose: 10, CIB: 30, New: 60 }, 'PS1': { Loose: 10, CIB: 40, New: 80 }, 'PS2': { Loose: 8, CIB: 30, New: 70 }, 'PC': { Loose: 5, CIB: 15, New: 30 }, 'XBOX': { Loose: 6, CIB: 25, New: 60 } }; if(heur[platform]) return heur[platform][condition] || heur[platform].Loose; const generic = { Loose: 20, CIB: 60, New: 150 }; return generic[condition] || generic.Loose; }function prettyTitle(key){ return key.replace(/:/g, ': ').replace(/\s{2,}/g,' ').replace(/\b([a-z])/g, function(m){ return m.toUpperCase(); }); } function expandPlatform(code){ return code; }// Enter key: choose suggestion or add inputTitle.addEventListener('keydown', function(e){ if(e.key === 'Enter'){ e.preventDefault(); const first = document.querySelector('#vg-suggestions-list-complete div'); if(first){ first.click(); return; } if(!btnAdd.disabled) btnAdd.click(); } });// init UI state updateAddButton(); renderTable(); } // end init })();