MoneyCents

cart · /core·type

Integer-cents money representation used for all arithmetic inside the cart kernel. Avoids floating-point rounding by working in the currency's minor units. Convert back to via .

Properties

cents
number
currencyCode

Example

const subtotal = money.parse(line.cost.subtotal);
const tax = money.mul(subtotal, 0.1);
const formatted = money.format(tax);

RunCartAdapterContractOpts runCartAdapterContract CartCapabilityUnsupportedError CartError CartNotFoundError CartProviderError CartUserError CartAdapter

Sourcemoney.ts:39Edit the JSDoc directly

On this page