quantlib.time.date.months

months(Period p)

Converts the period intho months as a float.

This will throw an exception if the time unit is not Years or Months.