Convert to integers for calculations.

With a MySQL database, I was getting "TypeError (String can't be coerced into Float)" on the /results display.  This resolved the issue.  It also works fine with this change and sqlite.