import { Currency, MoneyAmount, SUPPORTED_CURRENCIES } from "./currency-constants.js"; //#region src/utils/currencies.d.ts type SupportedCurrency = (typeof SUPPORTED_CURRENCIES)[number]; declare function moneyAmountToStripeUnits(amount: MoneyAmount, currency: Currency): number; /** * Inverse of `moneyAmountToStripeUnits`: formats an integer minor-unit amount * (e.g. cents) back into the canonical decimal money string for the currency. * E.g. for USD (2 decimals): 5000 → "50.00", 1 → "0.01"; for JPY (0 decimals): * 500 → "500". * * Prefer this over `String(number)` whenever an amount is scaled: money math * must happen in integer minor units, because float multiplication like * `19.99 * 3` yields `59.97000000000001`, which `moneyAmountSchema` then rejects * for having more than the currency's allowed decimals. * * Money amounts are non-negative (see `MoneyAmount`), so a negative input is a * programming error and throws rather than silently dropping the sign. */ declare function stripeUnitsToMoneyAmount(stripeUnits: number, currency: Currency): MoneyAmount; //#endregion export { SupportedCurrency, moneyAmountToStripeUnits, stripeUnitsToMoneyAmount }; //# sourceMappingURL=currencies.d.ts.map