quartersToMonths.cjs 611 B

123456789101112131415161718192021222324
  1. "use strict";
  2. exports.quartersToMonths = quartersToMonths;
  3. var _index = require("./constants.cjs");
  4. /**
  5. * @name quartersToMonths
  6. * @category Conversion Helpers
  7. * @summary Convert number of quarters to months.
  8. *
  9. * @description
  10. * Convert a number of quarters to a full number of months.
  11. *
  12. * @param quarters - The number of quarters to be converted
  13. *
  14. * @returns The number of quarters converted in months
  15. *
  16. * @example
  17. * // Convert 2 quarters to months
  18. * const result = quartersToMonths(2)
  19. * //=> 6
  20. */
  21. function quartersToMonths(quarters) {
  22. return Math.trunc(quarters * _index.monthsInQuarter);
  23. }