Skip to content

UseSalePrice

katanakit-js / useSalePrice

function useSalePrice(options): SalePrice;

Defined in: core/services/formatter.service.ts:277

Applies a discount and reports it. See FormatterService.useSalePrice.

Parameter Type Description
options { discount: number; price: number; } -
options.discount? number Discount rate: percentage when > 1 (e.g. 40 → 40%), or decimal fraction when in (0, 1] (e.g. 0.4 → 40%). Same convention as taxes.
options.price? number Regular price, before the discount.

SalePrice