UNPKG

752 BTypeScriptView Raw
1/**
2 * @name quartersToYears
3 * @category Conversion Helpers
4 * @summary Convert number of quarters to years.
5 *
6 * @description
7 * Convert a number of quarters to a full number of years.
8 *
9 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
10 *
11 * @param quarters - The number of quarters to be converted
12 *
13 * @returns The number of quarters converted in years
14 *
15 * @example
16 * // Convert 8 quarters to years
17 * const result = quartersToYears(8)
18 * //=> 2
19 *
20 * @example
21 * // It uses floor rounding:
22 * const result = quartersToYears(11)
23 * //=> 2
24 */
25export declare function quartersToYears(quarters: number): number;