Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Quantize Money

money.quantize

ProductionBounded custom (Class B)Deterministicstrictinstantv1.0.0
No network

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

Note
Round one monetary amount under an explicit or currency-derived scale

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

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

data-transformationmath

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input64 KB

How we handle your data

Sensitive input, safe output
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.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
amountstringYesRequired plain monetary decimal under the W00 ceilings.
currencystringYesRequired supported ISO 4217 code; sets the default scale.
scaleintegerNoOptional 0 to 12; omitted uses the currency minor units.
roundingModestringNoOptional supported RoundingPolicy mode; omitted means HALF_UP.

Output schema

FieldTypeRequiredDescription
amountstringYesRounded amount at exactly the resolved scale.
currencystringYesNormalized ISO 4217 code.
roundingDeltastringYesrounded amount minus input amount.
policyobjectYesResolved object with string mode, integer scale from 0 to 12, and string point equal to final.
currencyProfilestringYesVersioned currency metadata profile used for the default scale.

API contract

POST /v1/execute
curl
curl -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"}}'
Integrations
TypeScript SDK
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

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
AMOUNT_INVALID400NoThe request payload failed this skill's input validation.
CURRENCY_UNKNOWN400NoThe request payload failed this skill's input validation.
ROUNDING_INVALID400NoThe request payload failed this skill's input validation.

Other limits

LimitValue
Recommended inline bytes32 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)

Request bodyjson
{
  "skillKey": "money.quantize",
  "input": {
    "amount": "12.345",
    "currency": "USD"
  }
}

Examples

Default USD minor-unit scale

Inputjson
{
  "amount": "12.345",
  "currency": "USD"
}
Expected outputjson
{
  "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

Inputjson
{
  "roundingMode": "DOWN",
  "amount": "123.9",
  "currency": "JPY",
  "scale": 0
}
Expected outputjson
{
  "roundingDelta": "-0.9",
  "currency": "JPY",
  "policy": {
    "mode": "DOWN",
    "scale": 0,
    "point": "final"
  },
  "currencyProfile": "iso4217-2026-07",
  "amount": "123"
}
  • 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

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.

Tags

currencytransformationmath