Rocky_Mountain_Vending/.pnpm-store/v10/files/d3/d6a3e5e53997a8e4f4747d714d9c8e6bbfe09447d9913a6484750d648d7c010399b48e7c6e80cee3245efcf34b1a9bdfd9c4be3aabcdf4f5a781b752dd082c
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

31 lines
738 B
Text

import { quartersInYear } from "./constants.js";
/**
* @name quartersToYears
* @category Conversion Helpers
* @summary Convert number of quarters to years.
*
* @description
* Convert a number of quarters to a full number of years.
*
* @param quarters - The number of quarters to be converted
*
* @returns The number of quarters converted in years
*
* @example
* // Convert 8 quarters to years
* const result = quartersToYears(8)
* //=> 2
*
* @example
* // It uses floor rounding:
* const result = quartersToYears(11)
* //=> 2
*/
export function quartersToYears(quarters) {
const years = quarters / quartersInYear;
return Math.trunc(years);
}
// Fallback for modularized imports:
export default quartersToYears;