il problema è che mi viene visualizzato un risultato strano quando incontra un numero negativo nella riga:
itemtotal = (eval(theprice*thequantity));
Risultato:
descrizione Qta prezzo prezzo totale
Set–in reverse 1 € -120 € 0.0-11999![]()
![]()
non dovrebbe darmi -120? (-120*1) non è = -120?![]()
questo è uno stralcio di codice preso da una funzione:
itemlist = 0;
for (var i = 0; i <= fulllist.length; i++) {
if (fulllist.substring(i,i+1) == '[') {
itemstart = i+1;
} else if (fulllist.substring(i,i+1) == ']') {
itemend = i;
thequantity = fulllist.substring(itemstart, itemend);
itemtotal = 0;
itemtotal = (eval(theprice*thequantity));
temptotal = itemtotal * 100;
totprice = totprice + itemtotal + 0;
itemlist=itemlist+1;