[Solved] Convert x number of days to decimal year


Think about it…

700 days, 30 days in a month.

700/30 = 23.33 months. 12 months in a year.

23.33/12 = 1.944444… take the integer value (int)1.944444 to get 1 for the year.

23.33%12= 11.33… months. You can cast it to an int as well to get 11

Your result: 1 year, 11 months

1

solved Convert x number of days to decimal year