Skip to main content

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

MicroSkills Reference

Format Currency

finance.format_currency

ProductionEngine wrapper (Class A)Deterministicstrictfastv1.0.0
No network

Overview

You pass an amount, ISO 4217 currency code, and BCP 47 locale; we return a locale-appropriate display string. Rounding is applied explicitly before formatting and reported in the response. We do not convert currencies or parse formatted strings back into amounts. Do not use this for FX conversion or invoice arithmetic checks.

A formatter that quietly falls back to another locale, or re-rounds behind your back, turns a display bug into a reconciliation problem. We refuse unknown locales outright, round once with the mode you chose, and hand the rounding back to you in the response.

Reliability

Same input, same string, as long as the locale data stays on the version we report as cldrProfile — when that version moves, a separator or symbol placement can change with it, so pin the value if you diff formatted output. We round once, before formatting, and never a second time inside the formatter. MONEY_STYLE_UNSUPPORTED — trigger: a style that is not standard, accounting, compact or plain; retryable: no, the same style always fails; next: pick one of those four, or drop the field to get standard. LOCALE_UNSUPPORTED — trigger: a locale tag outside the seven we support, including close misses like fr-FR or a lower-cased en-us; retryable: no; next: send one of en-US, fr-BE, de-DE, ja-JP, hi-IN, ar-EG or tr-TR, exactly as written. CURRENCY_UNKNOWN — trigger: a blank code, or one outside the twenty currencies we support; retryable: no; next: send a supported ISO 4217 code such as EUR or USD. AMOUNT_INVALID — trigger: an amount we cannot read as a plain decimal — a thousands separator, an exponent, a blank string, or a magnitude past 1E18 — or a scale that is not a whole number between 0 and 12, or an unknown rounding mode; retryable: no; next: send the raw decimal without formatting and check the options object against the accepted values.

Context footprint

Returns formatted text, canonical amount, separators, and rounding metadata in one call. A successful call costs 1 execution credit.

When to use it

When you know the amount and the currency and you need the string a customer in that locale expects to read.

When you need an exchange rate, want a typed money string parsed back into a number, or are checking whether invoice lines add up.

Powered by ICU4J, the industry-standard Unicode locale library for currency and number formatting.

Scope

Note
Locale-aware display formatting when you already know the amount and currency.

Non-goals

  • Does not convert currencies or fetch exchange rates
  • Does not parse formatted strings back into numeric amounts
  • Does not format locales outside the pinned CLDR subset

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

formatting

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input4 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
amountobjectYesAmount to display as a plain decimal string or JSON number under 1E18, including negatives.
currencystringYesISO 4217 code shown in the formatted string and used for default decimals.
localestringYesPinned BCP 47 tag that decides separators, symbol placement and digit shapes.
stylestringNoPresentation of the formatted amount; omit it for standard.
optionsobjectNoOptional display controls for rounding mode, decimal scale, and whether the currency symbol is shown; omit it for HALF_UP, the currency scale, and the symbol shown.

Output schema

FieldTypeRequiredDescription
formattedstringYesLocale-ready display string including separators, symbol placement and digit shapes.
amountstringYesAmount actually formatted after rounding, as a decimal string at the applied scale for ledger reconciliation.
currencystringYesISO 4217 code that supplied the symbol and default decimals, upper-cased in the receipt.
localestringYesBCP 47 tag actually used for separators and digit shapes, never a fallback locale.
stylestringYesPresentation actually used, lower-cased, so accounting brackets are never mistaken for standard.
minorUnitsintegerYesOfficial fraction digits for this currency, which is also the default scale.
roundedbooleanYesTrue when extra decimals were rounded before formatting; false when the display matches the input digits.
roundingAppliedobjectYesClosed rounding receipt naming the mode and scale used before the display string was built.
_metaobjectNoPinned CLDR profile and the exact decimal and grouping separator characters used to build the string.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"finance.format_currency","input":{"amount":"12.34","currency":"EUR","locale":"en-US"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("finance.format_currency", {"options":{"rounding":"HALF_UP"},"locale":"fr-BE","currency":"EUR","style":"standard","amount":"1234567.891"});

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.
CURRENCY_UNKNOWN400NoThe request payload failed this skill's input validation.
LOCALE_UNSUPPORTED400NoThe skill does not support the requested variant.
AMOUNT_INVALID400NoThe request payload failed this skill's input validation.
MONEY_STYLE_UNSUPPORTED400NoThe skill does not support the requested variant.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not convert currencies or fetch exchange rates
  • Does not parse formatted strings back into numeric amounts
  • Does not format locales outside the pinned CLDR subset
  • Currency conversion or rate lookup
  • Parsing user-typed money strings
  • Validating invoice line arithmetic

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "finance.format_currency",
  "input": {
    "options": {
      "rounding": "HALF_UP"
    },
    "locale": "fr-BE",
    "currency": "EUR",
    "style": "standard",
    "amount": "1234567.891"
  }
}

Examples

Large EUR amount in Belgian French with explicit rounding

Inputjson
{
  "options": {
    "rounding": "HALF_UP"
  },
  "locale": "fr-BE",
  "currency": "EUR",
  "style": "standard",
  "amount": "1234567.891"
}
Expected outputjson
{
  "amount": "1234567.89",
  "currency": "EUR",
  "locale": "fr-BE",
  "roundingApplied": {
    "scale": 2,
    "mode": "HALF_UP"
  },
  "minorUnits": 2,
  "style": "standard",
  "formatted": "1 234 567,89 €",
  "rounded": true,
  "_meta": {
    "groupSeparator": " ",
    "decimalSeparator": ",",
    "cldrProfile": "icu-76.1"
  }
}

Accounting-style negative in US English

Inputjson
{
  "amount": "-12.34",
  "currency": "EUR",
  "locale": "en-US",
  "style": "accounting"
}
Expected outputjson
{
  "amount": "-12.34",
  "currency": "EUR",
  "locale": "en-US",
  "roundingApplied": {
    "scale": 2,
    "mode": "HALF_UP"
  },
  "minorUnits": 2,
  "style": "accounting",
  "formatted": "(€12.34)",
  "rounded": false,
  "_meta": {
    "groupSeparator": ",",
    "decimalSeparator": ".",
    "cldrProfile": "icu-76.1"
  }
}
  • Show invoice or receipt amounts in the customer's locale
  • Produce accounting-style negatives for ledger exports
  • Display compact amounts in dashboards

Avoid for

  • Currency conversion or rate lookup
  • Parsing user-typed money strings
  • Validating invoice line arithmetic

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

formattingcurrencyfinancelocale