Vabbè, ho fatto tutto da solo
E' bastato usare parseInt()