decimal-js
Skill1 starsChanged 3 months agoMITView on GitHub
Build, review, debug, migrate, or plan arbitrary-precision decimal math with decimal.js v10. Use for decimal.js, Decimal, Decimal.clone, Decimal.set, precision, rounding modes, ROUND_HALF_UP, ROUND_HALF_EVEN, toDecimalPlaces, toFixed, plus, minus, times, dividedBy, money/currency math, BigInt decimals, NaN/Infinity handling, trig/exp/ln, decimal.js-light, and comparisons with big.js or bignumber.js.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- ZeroTokenClaw/agents-skillsword for word, first seen Sep 21, 2026
Other versions1 project uses a version of this.
Word for word · 1
- ZeroTokenClaw/agents-skills★ 1100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository81 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agents-mdSkill
- base-uiSkill
- better-authSkill
- brainstormSkill
- bullmqSkill
- bunSkill
- clickhouseSkill
- clone-to-tempSkill
- compound-uiSkill
- copywritingSkill
- create-durable-planSkill
- d3Skill
- date-fnsSkill
- deduplicateSkill
- design-engineerSkill
- designSkill
- drizzle-ormSkill
- effectSkill
- elysia-architectureSkill
- elysiaSkill
- evlogSkill
- feedsmithSkill
- grokSkill
- handoffSkill
- heyapiSkill
- impitSkill
- intlayerSkill
- jsdocSkill
- kafkaSkill
- kill-legacySkill
- legend-stateSkill
- loopSkill
- mantine-hooksSkill
- mobbinSkill
- motionSkill
- oxfmtSkill
- oxlintSkill
- permixSkill
- plain-languageSkill
- playwrightSkill
- react-boundariesSkill
- react-emailSkill
- reactSkill
- reorganizeSkill
- researchSkill
- schema-dtsSkill
- sentrySkill
- seoSkill
- setup-competitors-mdSkill
- setup-copywriting-mdSkill
- setup-icp-mdSkill
- setup-project-mdSkill
- simplify-layoutSkill
- storybookSkill
- subagentsSkill
- tailwindSkill
- tailwind-variantsSkill
- takumiSkill
- tanstack-chartsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill for decimal.js v10 arbitrary-precision decimal arithmetic: construction, config, rounding, money-safe patterns, …
- Very specific: line 26
Verify with typecheck plus tests for string construction, rounding mode, toDP/toFixed, and serialization round-trips.
- Very specific: line 49
Prefer Decimal.clone({…}) for libraries and multi-domain apps.
- Very specific: line 52
Default rounding is ROUND_HALF_UP (4).
- Distinctive: line 57
Prefer repository-owned commands.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
decimal.js
Use this skill for decimal.js v10 arbitrary-precision decimal arithmetic: construction, config, rounding, money-safe patterns, serialization, and advanced math.
Workflow
- Inspect the local surface before changing code:
- Package:
decimal.js(and siblingsdecimal.js-light,bignumber.js,big.jsif present). - Version: target v10 (current
10.6.0); bundleddecimal.d.ts(BigInt in types since 10.6.0). - Domain: money/currency, scientific, or general — this drives
cloneconfig and whether significant-digitprecisionalone is enough. - Imports: default or named
Decimalfrom"decimal.js".
- Package:
- Refresh docs when versions are unclear or work touches rounding, money, trig, or library isolation. Start from source-map.md.
- Route deeper detail:
- Install, constructor, immutability, Value types: setup-core.md.
- Arithmetic, compare, format, static helpers: arithmetic-api.md.
set/config/clone, rounding modes, modulo: config-rounding.md.- Money, JSON/SSR/store transport: money-serialization.md.
- Trig, random/crypto, light vs full, MikeMcl ecosystem: advanced-ecosystem.md.
- Anti-patterns and upgrades: pitfalls.md.
- Match the project's constructor style (
Decimalvs domainclone). Do not call globalDecimal.setinside published libraries. - Verify with typecheck plus tests for string construction, rounding mode,
toDP/toFixed, and serialization round-trips.
Library Decision Tree
Need trig / ln / exp / non-integer pow / wide exponents?
→ decimal.js (this skill)
Exact add/mul until division, finance-first, smaller API?
→ consider bignumber.js (author guidance) — or stay on decimal.js with Money clone + toDP
Tiny bundle, basic DP only?
→ big.js or decimal.js-light
Using decimal.js for money anyway?
→ Decimal.clone({ precision: 28, rounding: … }) + construct from strings + round once with toDP/toFixedCore Judgment
- Construct from strings (or BigInt / Decimal) for money and multi-digit values. Never
new Decimal(0.1 + 0.2)or Number arithmetic first. - Instances are immutable. Chain methods; do not expect in-place mutation.
precision= significant digits for (almost) all arithmetic results — not currency decimal places. UsetoDecimalPlaces/toDP(ortoFixedfor strings) for fixed fractional places.- Prefer
Decimal.clone({…})for libraries and multi-domain apps. UseDecimal.setonly for app-wide boot config. - Value equality:
.eq/.cmp, never===/==. - Serialize as strings (
toJSON/toFixed/toString). AvoidtoNumber()for money or persisted values. - Default rounding is
ROUND_HALF_UP(4). Pick explicitly for finance (HALF_UP/HALF_EVEN/ jurisdiction rules). - Configure via
set/config/clone— never assignDecimal.precision = …directly (skips validation).
Verification
Prefer repository-owned commands. Cover the relevant subset:
bun pm ls decimal.js(and light / big / bignumber if migrating).- Typecheck for
Decimal.Value,Decimal.Config, clone constructors. - Tests: string vs number construction,
eqvs===,toDP/toFixedrounding modes, penny-allocation / tax edges, JSON hydrate (new Decimal(dto.amount)), signed zero if relevant. - Bundle/size check only when choosing light vs full.
Report which checks ran, which did not, and version/config assumptions that remain.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

