function toMinorUnits
toMinorUnits(
majorUnits: number,
currency?: string,
): number

Convert major units (decimal) to minor units (integer). e.g. toMinorUnits(10.50) → 1050 (for GBP) currency defaults to the site's currency; a caller converting a charge taken in another currency passes that currency so the divisor matches it.

Parameters

majorUnits: number
optional
currency: string = [settings.currency]

Return Type

number

Usage

import { toMinorUnits } from "doc.ts";