UNPKG

@coursebuilder/core

Version:

Core package for Course Builder

17 lines (15 loc) 538 B
import { __name } from "./chunk-VLQXSCFN.js"; // src/lib/pricing/get-calculated-price.ts function getCalculatedPrice({ unitPrice, percentOfDiscount = 0, quantity = 1, fixedDiscount = 0 }) { const fullPrice = unitPrice * quantity; const discountMultiplier = 1 - percentOfDiscount; const calculatedPrice = ((fullPrice - fixedDiscount) * discountMultiplier).toFixed(2); return Number(calculatedPrice); } __name(getCalculatedPrice, "getCalculatedPrice"); export { getCalculatedPrice }; //# sourceMappingURL=chunk-PQKCCDCP.js.map