function formatCurrency
formatCurrency(
minorUnits: number | string,
currency?: string,
): string

Format an amount in minor units (pence/cents) as a currency string. e.g. formatCurrency(1050) → "£10.50" (when the site currency is GBP). A stored provider amount passes its own currency so the symbol and minor-unit divisor describe that charge rather than today's site setting.

Parameters

minorUnits: number | string
optional
currency: string = [settings.currency]

Return Type

string

Usage

import { formatCurrency } from "doc.ts";