Functional Weave
Code in TypeScript

Results for “units”

100 capabilities

form.money-input
Read a typed amount as minor units for its currency and locale, check min/max, and format it back.
A group of 3: parseMoneyInput, formatMoneyInput, moneyInputFormat
money.parse
Parse "£1,234.50" or "1.234,50 €" into integer minor units, strictly: no guessing, no rounding.
parseMoney in TypeScript
energy.gas-kwh
Convert gas meter units (cubic metres or hundreds of cubic feet) to kWh with the calorific value and 1.02264 correction.
gasKwh in TypeScript
react.form.money-field React ^19 · TypeScript only
A money input with its currency symbol, locale separators and min/max, read and checked by form.money-input.
MoneyField in TypeScript
logistics.sscc
Build an 18-digit SSCC pallet label number from extension digit, GS1 company prefix and serial, with its check digit.
buildSscc in TypeScript
invest.fee-drag Unreviewed
What an annual charge costs an investment over the years: value with and without the fee, year by year, in minor units.
feeDrag in TypeScript
math.basis-points
Convert a rate between percent, basis points and a plain ratio exactly, as decimal text or integer basis points.
A group of 3: convertRate, toBasisPoints, fromBasisPoints
fleet.emissions
Vehicle greenhouse gas emissions (grams CO2e) from fuel used or distance, using UK government DESNZ conversion factors.
fleetEmissions in TypeScript
payments.stripe-checkout Integration · does I/O TypeScript only
Start a Stripe Checkout session and verify Stripe's signed webhooks, with a local stand-in for development.
A group of 3: createCheckoutSession, verifyWebhook, signWebhook
form.file-check
Check files chosen in an upload field: accept types, size, empty files and how many, with GOV.UK messages.
A group of 3: validateFiles, acceptsFile, formatFileSize
math.exp
e to the power x from + - * / only, so TypeScript, Python and Rust return the same double for the same input.
exp in TypeScript
math.ln
Natural logarithm from + - * / only, so TypeScript, Python and Rust return the same double for the same input.
ln in TypeScript
math.atan
Arctangent in radians from + - * / only (fdlibm's method), so every language returns the same double.
atan in TypeScript
charts.format
Axis and label text for charts: tick numbers, SI prefixes (1.2k, 3.4M), percentages, dates and money.
A group of 5: formatTick, formatSi, formatPercent, formatDate, formatMoneyTick
fleet.fuel-cost
Fuel cost of a trip from distance, fuel economy (UK or US mpg, or L/100km) and price per litre, exactly.
fuelCost in TypeScript
text.number-to-words
Write a money amount in words for a cheque: "one thousand two hundred and thirty-four pounds and fifty-six pence".
amountInWords in TypeScript
health.egfr Unreviewed
eGFR in mL/min/1.73 m² by the race-free CKD-EPI 2021 creatinine equation, from creatinine in µmol/L or mg/dL.
egfrCkdEpi2021 in TypeScript
retail.basket-total
Total a basket: line prices, promotions, a basket discount, VAT per line and delivery, into one checked total.
basketTotal in TypeScript
math.rational
Exact fraction arithmetic, always reduced, for rates and ratios that must not drift.
A group of 8: calculateRational, rational, addRational, subtractRational, multiplyRational, divideRational, compareRational, rationalToInteger