Quantize Money
money.quantize
Overview
Round one monetary amount under an explicit or currency-derived scale. The skill uses exact decimal arithmetic, reports the resolved policy, rejects unknown properties, and never fetches a rate or infers accounting policy.
Money arithmetic needs explicit currency, scale, tolerance, and rounding semantics; an LLM cannot guarantee those constraints or reproduce residuals.
Reliability
STRICT and stateless. AMOUNT_INVALID means a malformed or over-limit decimal; fix it. CURRENCY_UNKNOWN means the code is outside the documented allowlist; send a supported code. CURRENCY_MISMATCH is triggered when one sum contains different currency codes; retry only after converting first or splitting the rows by currency. TOLERANCE_INVALID means a negative or unsupported tolerance; correct its type and value. ROUNDING_INVALID means mode or scale is unsupported; choose a documented value. ITEM_LIMIT_EXCEEDED means more than 10,000 rows; split them.
Context footprint
One call returns normalized money strings and the resolved policy. A successful call costs 1 execution credit.
When to use it
When one monetary amount must be rounded to a currency's minor units or an override scale.
When you only need an unrounded total, or the ISO currency code is still unknown.
Scope
Non-goals
- Does not fetch FX rates or convert currencies
- Does not infer materiality, accounting policy, cash rounding, or locale
- Does not accept unbounded lists or binary floating-point semantics
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| amount | string | Yes | Required plain monetary decimal under the W00 ceilings. |
| currency | string | Yes | Required supported ISO 4217 code; sets the default scale. |
| scale | integer | No | Optional 0 to 12; omitted uses the currency minor units. |
| roundingMode | string | No | Optional supported RoundingPolicy mode; omitted means HALF_UP. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| amount | string | Yes | Rounded amount at exactly the resolved scale. |
| currency | string | Yes | Normalized ISO 4217 code. |
| roundingDelta | string | Yes | rounded amount minus input amount. |
| policy | object | Yes | Resolved object with string mode, integer scale from 0 to 12, and string point equal to final. |
| currencyProfile | string | Yes | Versioned currency metadata profile used for the default scale. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"money.quantize","input":{"amount":"12.345","currency":"USD"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("money.quantize", {"amount":"12.345","currency":"USD"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| AMOUNT_INVALID | 400 | No | The request payload failed this skill's input validation. |
| CURRENCY_UNKNOWN | 400 | No | The request payload failed this skill's input validation. |
| ROUNDING_INVALID | 400 | No | The request payload failed this skill's input validation. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not fetch FX rates or convert currencies
- Does not infer materiality, accounting policy, cash rounding, or locale
- Does not accept unbounded lists or binary floating-point semantics
- When you only need an unrounded total, or the ISO currency code is still unknown.
- Do not use when tolerance, scale, or rounding policy is still undecided
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "money.quantize",
"input": {
"amount": "12.345",
"currency": "USD"
}
}Examples
Default USD minor-unit scale
{
"amount": "12.345",
"currency": "USD"
}{
"roundingDelta": "0.005",
"currency": "USD",
"policy": {
"mode": "HALF_UP",
"scale": 2,
"point": "final"
},
"currencyProfile": "iso4217-2026-07",
"amount": "12.35"
}Explicit whole-yen rounding down
{
"roundingMode": "DOWN",
"amount": "123.9",
"currency": "JPY",
"scale": 0
}{
"roundingDelta": "-0.9",
"currency": "JPY",
"policy": {
"mode": "DOWN",
"scale": 0,
"point": "final"
},
"currencyProfile": "iso4217-2026-07",
"amount": "123"
}Recommended use cases
- When one monetary amount must be rounded to a currency's minor units or an override scale.
- Use for auditable ledger arithmetic with explicit monetary units
Avoid for
- When you only need an unrounded total, or the ISO currency code is still unknown.
- Do not use when tolerance, scale, or rounding policy is still undecided
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.