Money
Money helpers
Money
Integer minor-unit Money helpers from @booki-aui/core.
The person sees
$125.00
($4,250.00)
pnpm add @booki-aui/coreUsage example
import {
addMoney, formatMoney, minorFromDecimal, money,
} from "@booki-aui/core/money"
const net = money(minorFromDecimal("125.00", "USD"), "USD")
const tax = money(1000, "USD")
const total = addMoney(net, tax)
console.log(total) // { minor: 13500, currency: "USD" }
console.log(formatMoney(total, { locale: "en-US" })) // $135.00Keep 13500 cents in storage and format $135.00 for display. addMoney requires matching currencies.