function fixAmount(amount) { if(typeof amount == "string") amount = amount.replace(',','.'); return parseFloat(amount)||-1; }