converting double values from db to int