Format Currency
finance.format_currency
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
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
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 | object | Yes | Amount to display as a plain decimal string or JSON number under 1E18, including negatives. |
| currency | string | Yes | ISO 4217 code shown in the formatted string and used for default decimals. |
| locale | string | Yes | Pinned BCP 47 tag that decides separators, symbol placement and digit shapes. |
| style | string | No | Presentation of the formatted amount; omit it for standard. |
| options | object | No | Optional 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
| Field | Type | Required | Description |
|---|---|---|---|
| formatted | string | Yes | Locale-ready display string including separators, symbol placement and digit shapes. |
| amount | string | Yes | Amount actually formatted after rounding, as a decimal string at the applied scale for ledger reconciliation. |
| currency | string | Yes | ISO 4217 code that supplied the symbol and default decimals, upper-cased in the receipt. |
| locale | string | Yes | BCP 47 tag actually used for separators and digit shapes, never a fallback locale. |
| style | string | Yes | Presentation actually used, lower-cased, so accounting brackets are never mistaken for standard. |
| minorUnits | integer | Yes | Official fraction digits for this currency, which is also the default scale. |
| rounded | boolean | Yes | True when extra decimals were rounded before formatting; false when the display matches the input digits. |
| roundingApplied | object | Yes | Closed rounding receipt naming the mode and scale used before the display string was built. |
| _meta | object | No | Pinned CLDR profile and the exact decimal and grouping separator characters used to build the string. |
API contract
POST /v1/executecurl -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"}}'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
| 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. |
| CURRENCY_UNKNOWN | 400 | No | The request payload failed this skill's input validation. |
| LOCALE_UNSUPPORTED | 400 | No | The skill does not support the requested variant. |
| AMOUNT_INVALID | 400 | No | The request payload failed this skill's input validation. |
| MONEY_STYLE_UNSUPPORTED | 400 | No | The skill does not support the requested variant. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 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)
{
"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
{
"options": {
"rounding": "HALF_UP"
},
"locale": "fr-BE",
"currency": "EUR",
"style": "standard",
"amount": "1234567.891"
}{
"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
{
"amount": "-12.34",
"currency": "EUR",
"locale": "en-US",
"style": "accounting"
}{
"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"
}
}Recommended use cases
- 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
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.