← all projects
5,000+ Downloads

Monie Utils

Comprehensive TypeScript money utilities for fintech. 20+ currencies with African market focus, banker's rounding, loan calculations, zero dependencies.

Production-ready fintech utilities with 5,000+ downloads. Supports Nigerian Naira, Kenyan Shilling, and 20+ currencies with precise calculations.

TypeScript
Fintech
Currency

Problem Statement

Money is the one thing software cannot get wrong, yet JavaScript makes it dangerously easy to: floating-point drift (0.1 + 0.2), inconsistent locale formatting, mishandling the smallest unit (cents vs naira vs satoshis), and reinventing loan/interest math in every project. Most apps scatter ad-hoc money helpers across the codebase, untested and locale-naive — especially painful in fintech and in African markets that need NGN/KES support and crypto.

Proposed Solution

Monie Utils is a single, type-safe, zero-dependency, tree-shakeable TypeScript library that consolidates everything money-related: currency formatting (incl. compact and crypto), validation, conversion, percentage formatting, locale rules, and financial calculations (interest, loans, investments) plus business utilities (payments, subscriptions, analytics).

Full Solution Details

  • FormattingformatCurrency (rich result object: formatted string, amount, currency, locale, isCompact), formatMoney (simple string), formatCents (from smallest unit — handles USD cents and BTC satoshis), formatCompactCurrency ($1.5M, $2.5B).
  • PercentagesformatPercentage(0.1525)15.25%, with precision + locale.
  • LocalizationformatCurrencyByLocale, getLocaleCurrencyInfo (e.g. de-DE1.234,56 €).
  • ValidationisValidAmount (rejects NaN), isValidCurrency (incl. crypto like BTC).
  • Financial calculations — interest, loan amortization, investment tracking, subscription billing.
  • 20+ currencies with explicit focus on African markets (NGN, KES) alongside USD/EUR and crypto.

Technical Documentation

Pure TypeScript, zero runtime dependencies, tree-shakeable (import only the functions you use), MIT-licensed, published to npm with a dedicated docs site. 100% type coverage; comprehensive test suite. The API favors rich return objects for the heavy formatters (so callers get amount + locale + flags, not just a string) while keeping ergonomic string-only variants (formatMoney) for the common case. Smallest-unit handling is first-class (formatCents) so financial code never juggles ×100 / ×1e8 conversions by hand.

Tech Stack

TypeScript, npm distribution, tree-shaking (ESM), Intl/locale APIs; zero third-party dependencies.

System Design

monie-utils (zero-dep, tree-shakeable)
 ├── formatting/   formatCurrency · formatMoney · formatCents · formatCompactCurrency
 ├── percentage/   formatPercentage
 ├── locale/       formatCurrencyByLocale · getLocaleCurrencyInfo
 ├── validation/   isValidAmount · isValidCurrency (fiat + crypto)
 ├── calculations/ interest · loans · investments
 └── business/     payments · subscriptions · analytics
        every export individually importable → minimal bundle impact

Smart Architectural Decisions

  • Zero dependencies + tree-shaking. A money library you can drop into any fintech bundle without dragging in transitive deps or bloating the build — each util is independently importable.
  • Smallest-unit as a first-class concept. formatCents handling both cents and satoshis encodes the correct mental model for money (store integers, format late), preventing a whole class of rounding bugs.
  • Rich-object + simple-string dual API. Power users get structured results (locale, flags, parsed amount); simple call sites get a string — ergonomics without losing information.
  • African-market + crypto coverage fills a real gap: most money libs assume USD/EUR; this one ships NGN/KES and BTC validation, matching the author's fintech focus.

Impacts

5,000+ npm downloads; used in real fintech products. Gives any TypeScript project correct, locale-aware, well-tested money handling — including African currencies and crypto — without writing (and mis-testing) it from scratch.

Demonstrated Skills

Library/API design (dual ergonomic surfaces, rich result types); financial domain correctness (smallest-unit handling, amortization/interest math); i18n/locale formatting; zero-dependency + tree-shakeable packaging; TypeScript types; OSS testing, docs, and npm release discipline.

Notes

  • 5,000+ downloads — the most-installed library in the portfolio; real strangers ship it in production.
  • Domain correctness signal: treating the smallest unit (cents/satoshis) as first-class and providing banker's-style precise calculations shows the author understands why money + floats is dangerous — exactly what a fintech employer wants.
  • Zero-dependency, tree-shakeable demonstrates packaging discipline and respect for downstream bundle size.
  • Market insight: explicit NGN/KES + crypto support targets an underserved niche and aligns with his broader Nigerian-fintech body of work (TrustRail, MoneyWrapped).
  • 100% type coverage, full docs site, MIT — production-grade OSS hygiene.
Ask me anything