
February 26th, 2013, 01:01 AM
|
|
|
|
Integer versus strings
Code:
$('tr[name=itemrow]').each(function()
{
var $price = $(this).find('input[name="price[]"]').val();
var $item = $(this).attr('which');
if(sellvalue[$item] > $price)
{
$(this).find('b').wrap('<font color="red"/>');
}
});
I've figured out that $price is a string, and though you cannot see the declaration of the array sellvalue it's an array of strings too. This means 750 is greater than 10,000.
How do I make it treat $price and sellvalue[$item] as integers so that 750 is less than 10,000?
|