← All packages

@lacspace/currency

v1.0.0Global Data Kit0 deps

ISO 4217 currencies — codes, numeric codes, minor units asserted against the ISO list (0 for JPY, 3 for BHD, 4 for CLF), names, symbols, fund/special classification and Intl-free formatting for en/de/fr/ch/in locales. Zero-dependency, isomorphic.

npm i @lacspace/currency

Usage

currency.ts
import { minorUnits, toMinor, formatCurrency } from "@lacspace/currency";

minorUnits("JPY");                                   // 0
toMinor(19.99, "USD");                               // 1999
formatCurrency(1234.5, "EUR", { locale: "de" });    // "1.234,50 €"

Exports 10

currencycurrenciesisCurrencyCodecurrencyNamecurrencySymbolminorUnitstoMinorfromMinorformatCurrencyFUND_CODES

Keywords

iso-4217currency-codescurrenciesminor-unitscurrency-symbolscurrency-formatmoney

More in Global Data Kit

@lacspace/country

ISO 3166-1 countries with alpha-2/alpha-3/numeric codes, names, calling codes, currencies, top-level domains, regions and flag emoji — lookup by any code, name or alias, search, and typed data. Every code and ICU's name for it are cross-checked in the tests. Zero-dependency, isomorphic.

@lacspace/iban

Validate, parse and format IBANs (ISO 13616 registry for 90 countries, MOD 97-10) with bank/branch/account extraction, SEPA flag and generation, plus BIC/SWIFT (ISO 9362) and ISIN (ISO 6166) checks. Every registry example is verified by its own check digits. Zero-dependency, isomorphic.

@lacspace/tax-id

Validate tax and business identifiers with their real checksums — EU VAT (all 27 + UK/XI), Indian GSTIN and PAN, Australian ABN/ACN/TFN, NZ IRD, Canadian BN, US EIN, Brazilian CPF/CNPJ, Argentine CUIT, Chilean RUT, Mexican RFC, Nepali PAN, Singapore UEN, Korean BRN, Japanese corporate number and more — reporting checksum vs format strength. Zero-dependency, isomorphic.

@lacspace/phone

Parse, validate and format international phone numbers — E.164, national and international formats, country detection from the calling code (shared +1/+44/+7 codes resolved by leading digits), trunk prefixes, extensions, per-country length rules and mobile detection for 80+ countries. Isomorphic.

@lacspace/postal-code

Validate and normalise postal codes for 130 countries — ZIP, postcode, PIN, CEP — with the national spacing and casing (SW1A 1AA, K1A 0B1, 01310-100), and knows which countries have no postal codes. Zero-dependency, isomorphic.