Agent Skills
› nodetool-ai/nodetool
› sandbox-decimal
sandbox-decimal
GitHub提供高精度十进制算术支持,解决浮点数精度丢失问题。适用于金额计算、精确除法及避免小数噪声的场景。
Trigger Scenarios
需要精确金额计算
避免浮点数精度误差
Install
npx skills add nodetool-ai/nodetool --skill sandbox-decimal -g -y
SKILL.md
Frontmatter
{
"name": "sandbox-decimal",
"description": "Exact decimal arithmetic inside a Code node or CodeAct action, with decimal.js running in the guest"
}
Decimals in the sandbox
Specifier: @nodetool-ai/sandbox-decimal. One module, decimal.js. Import it
at the top of the body.
Exact sums
import Decimal from "@nodetool-ai/sandbox-decimal";
const total = inputs.amounts
.reduce((sum, n) => sum.plus(n), new Decimal(0));
return { total: total.toFixed(2) };
Divide without float noise
import Decimal from "@nodetool-ai/sandbox-decimal";
const share = new Decimal(inputs.cents).div(inputs.parts);
return { share: share.toFixed(2) };
Gotchas
- Default export.
import Decimal from "@nodetool-ai/sandbox-decimal". - Pass strings or Decimals.
new Decimal(0.1)already lost precision; usenew Decimal("0.1"). - The guest has no Intl. Format with
toFixed/toString, nottoLocaleString.
Version History
- a6a7e57 Current 2026-08-20 09:52


