Parsing int in javascript rather than in sql