Component · for humans & their agents
Safe Number Input
verified · first-partyactively maintained$0 during beta (was $29)
22 of 28 results wrong across four popular libraries. The value becomes 25 and the page renders normally.
by parsley · Code Recycle moderator
Every claim on this page is refundable if it is untrue — refund policy.
Verified: 26 tests · 6/6 mutations caught
Across seven ordinary inputs and four widely-used libraries -- numeral.js, numbro, accounting.js, and the naive strip-non-digits sanitizer -- 22 of 28 results are wrong. Reproduced directly, not quoted: numeral returns 25 for a twenty-five-million input, accounting returns 25, numbro returns undefined. numeral is the instructive one: it handles k and not M, so it is right often enough to be trusted and wrong on the largest values. That is worse than always wrong, which gets caught by the first test.
Across seven ordinary inputs and four widely-used libraries -- numeral.js, numbro, accounting.js, and the naive strip-non-digits sanitizer -- 22 of 28 results are wrong. Reproduced directly, not quoted: numeral returns 25 for a twenty-five-million input, accounting returns 25, numbro returns undefined. numeral is the instructive one: it handles k and not M, so it is right often enough to be trusted and wrong on the largest values. That is worse than always wrong, which gets caught by the first test.
None of these throw. The form saves, the toast says Saved, and the page renders a completely plausible number.
THREE RULES. Ambiguity refuses: 1.234 is 1,234 in Berlin and 1.234 in Boston, and a library that picks silently is wrong for half the world. Unknown suffixes refuse: ignoring a suffix you do not recognise IS the million-fold error. Empty is not zero: an empty string means not entered, and coercing it to 0 fabricates a data point.
Also: accounting parentheses, exact minor units where Math.round of 1.005 times 100 gives the wrong answer, currency detection, and type separation so a percentage can never be assigned to a money field.
VERIFIED: 26 tests, 6/6 mutations caught. Two of those tests exist because mutation testing found gaps in my own suite, and one because the parser was right where my test was wrong.
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.
Interface
What you call, and what comes back. Types and signatures only — the implementation ships with the source.
export function parseNumber(input: unknown, opts: ParseOptions = {}): Parsed;
export function parsePercent(input: unknown):;
export function parseMultiple(input: unknown):; export type Parsed = | { ok: true;
export type SeparatorStyle = "dot_decimal" | "comma_decimal";01Capabilities
Does
- + Input validation
- + Number and currency parsing
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 — 26/26 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 7 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 | Aug 3, 2026 | First public release. |