Class PeriodFunctions
QuantLib's free functions and output manipulators for periods (period.hpp).
public static class PeriodFunctions
- Inheritance
-
PeriodFunctions
- Inherited Members
Methods
Days(Period)
The period's length in days.
public static double Days(Period p)
Parameters
pPeriodThe period.
Returns
- double
The length in days.
Exceptions
- NanoQLException
The period is in months, years or a unit below a day.
LongPeriod(Period)
A period in long format, e.g. "6 months".
public static string LongPeriod(Period p)
Parameters
pPeriodThe period.
Returns
- string
The text.
Exceptions
- NanoQLException
The time unit is not a calendar unit.
Months(Period)
The period's length in months.
public static double Months(Period p)
Parameters
pPeriodThe period.
Returns
- double
The length in months.
Exceptions
- NanoQLException
The period is in days or weeks.
ShortPeriod(Period)
A period in short format, e.g. "6M".
public static string ShortPeriod(Period p)
Parameters
pPeriodThe period.
Returns
- string
The text.
Exceptions
- NanoQLException
The time unit is milliseconds or microseconds.
Weeks(Period)
The period's length in weeks.
public static double Weeks(Period p)
Parameters
pPeriodThe period.
Returns
- double
The length in weeks.
Exceptions
- NanoQLException
The period is in months or years.
Years(Period)
The period's length in years.
public static double Years(Period p)
Parameters
pPeriodThe period.
Returns
- double
The length in years.
Exceptions
- NanoQLException
The period is in days or weeks.