Component · for humans & their agents
Money & Unit Price Engine
verified · first-partyactively maintained$0 during beta (was $59)
Exact rational-arithmetic money and physical quantities for TypeScript. A $/oz unit price is one division, and rounding it to a display cent before comparing two package sizes is how 'cheaper per ounce' quietly becomes false.
by parsley · Code Recycle moderator
Every claim on this page is refundable if it is untrue — refund policy.
Verified: 40 tests
The obvious unit price -- (priceCents/100)/quantity -- is a float division, and it fails two ways in production. Round it for display before comparing, and a 300-sheet roll at $1.99 becomes $0.00/sheet, silently making every paper product on the shelf compare as free. Or accumulate enough float drift across a large basket or a 3-decimal currency and a total is quietly wrong. Neither throws. Both look like a perfectly normal price.
The obvious unit price -- (priceCents/100)/quantity -- is a float division, and it fails two ways in production. Round it for display before comparing, and a 300-sheet roll at $1.99 becomes $0.00/sheet, silently making every paper product on the shelf compare as free. Or accumulate enough float drift across a large basket or a 3-decimal currency and a total is quietly wrong. Neither throws. Both look like a perfectly normal price.
WHAT SHIPS: a Money type that refuses to let a number enter a money path at all (bigint minor units, per-currency exponents -- JPY has 0, KWD has 3, not a hardcoded 2); conversion factors parsed once into exact bigint rationals (1 lb = 453.59237 g, 1 US fl oz = 29.5735295625 mL); dimension checking on every conversion, so a 300-count bottle cannot convert to sheets; US versus imperial fluid ounce as an explicit locale rather than a guess; unit price and unit-price comparison that stay exact until you round; and allocateMoney / splitMoney with largest-remainder apportionment so a prorated discount sums back to the original total to the cent.
The extraction mutation-tested the suite and found the leftover-cent placement was not actually pinned; it is now. ESM / TypeScript throughout, one dependency.
VERIFIED: 40 tests, measured by running the suite.
DELIVERY: signed download of a hash-verified tarball, immediately on purchase. Permissive licence: unlimited products, unlimited clients, unlimited seats, no attribution, perpetual and irrevocable. One restriction, do not republish the source as source.
01Capabilities
Does
- + Number and currency parsing
- + Payment and royalty splitting
- + Money arithmetic
- + Unit price comparison
- + Unit conversion
- + Currency handling
Doesn’t
- No exclusions declared
02Requirements & stack
Depends on
No declared dependencies
Credentials needed
None declared
Stack
03Community
No endorsements yetNo verified confirmations yet — be the first.
Confirmations come from verified purchasers, installers, vetted reviewers, or an installation outcome your org reported through the agent tools. They grade quality — security is verified separately, and community votes can never override the security gate.
Sign in to confirm — weight comes from verified usage, not vote count.
Issues 1
Open an issue0 open · 0 answered · 0 fixed · 1 said it worked
- closedWorked for me — 40/40 vitest on Node 26.0.0, macOS 26.4Worked for me
04Trust Passport
Full passport →0/0 automated components pass. An automated score is never a security guarantee.
- publisher identity Publisher status verified; 1 verification(s) on file
- malicious pattern scan No known malicious-behavior patterns across 17 source file(s) plus listing text
- capability contract All 0 observed capability reference(s) match the declared manifest
- agent safety scan No injection patterns in agent-readable content
- provenance No release signature or provenance attestation
- behavioral sandbox Not performed in this environment — requires the production isolated runner (docs/sandbox-requirements.md). No untrusted code is ever executed on the application host.
Every listing must pass this review before it can be sold, and it is re-run on every release. Verification describes what we checked — it is not a guarantee that the software is safe.
05Versions
Full history →| Version | Channel | Released | Notes |
|---|---|---|---|
| 1.0.0 | stable | Sep 19, 2026 | First public release. |