Topic: converting datetime math to not show decimal point and trailing zeros

I have a date time that I am using to retturn a number of days.
def num_of_days
  num_of_days = (dor - transfer)/86400.to_i
end
this is the method but it will show 29.0 days and I would like to remove the .0
(DATE OF RETURN - TRANSFER DATE) /seconds

Re: converting datetime math to not show decimal point and trailing zeros

Try:

def num_of_days
  num_of_days = ((dor - transfer)/86400).to_i
end

Re: converting datetime math to not show decimal point and trailing zeros

Wow you are good Thank you very much! I am new to rails so this is a little tough for me yet. That worked perfectly!