Skip to main content

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

MicroSkills Reference

Calculate Percent Change

math.percent_change

ProductionBounded custom (Class B)Deterministicstrictinstantv1.0.0
No network

Overview

Calculate relative and percentage change with explicit zero-baseline behavior. Inputs are bounded plain decimals, output order follows input order, and no currency, policy, materiality threshold, market data, or ambient default is inferred.

For Calculate Percent Change, we publish the exact bounded decimal rule and audit fields so you do not have to trust approximate prompt arithmetic.

Reliability

Calculate Percent Change is STRICT and stateless: the same bounded input produces the same normalized output. DECIMAL_INVALID means a value is malformed or outside the 100-digit/scale-40 ceilings; fix it before retrying. ITEM_LIMIT_EXCEEDED means an array exceeds 10,000 entries; split it. ZERO_DENOMINATOR means a denominator or weight sum is zero; change it or select the documented zero policy. ROUNDING_INVALID means mode, scale, or quantization is invalid; send a supported mode and scale. ALLOCATION_INVALID means weights, ids, or total violate the published allocation rules; correct the named structure.

Context footprint

For Calculate Percent Change, one bounded call replaces an error-prone arithmetic prompt and returns normalized decimal strings. A successful call costs 1 execution credit.

When to use it

When you hold a baseline and a new value and need the relative change, including a zero-baseline policy.

When you need a ratio rather than a percentage, or the baseline convention is still missing.

Scope

Note
Calculate relative and percentage change with explicit zero-baseline behavior

Non-goals

  • Does not infer a rounding, materiality, currency, or business policy
  • Does not fetch market data or invoke another public skill
  • Does not accept unbounded arrays 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
oldValuestringYesRequired plain-decimal baseline; zero follows zeroPolicy.
newValuestringYesRequired plain-decimal comparison value.
zeroPolicystringNoOptional error, undefined or zero; omitted means error.

Output schema

FieldTypeRequiredDescription
definedbooleanYesTrue when oldValue was non-zero.
changestringNoRelative change; omitted only for zeroPolicy undefined.
changePercentstringNoRelative change multiplied by 100; omitted only for zeroPolicy undefined.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"math.percent_change","input":{"oldValue":"80","newValue":"100"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("math.percent_change", {"oldValue":"80","newValue":"100"});

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.
DECIMAL_INVALID400NoThe request payload failed this skill's input validation.
ZERO_DENOMINATOR400NoThe request payload failed this skill's input validation.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not infer a rounding, materiality, currency, or business policy
  • Does not fetch market data or invoke another public skill
  • Does not accept unbounded arrays or binary floating-point semantics
  • When you need a ratio rather than a percentage, or the baseline convention is still missing.
  • Do not use for approximate floating-point analytics or unbounded datasets

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "math.percent_change",
  "input": {
    "oldValue": "80",
    "newValue": "100"
  }
}

Examples

Growth from 80 to 100

Inputjson
{
  "oldValue": "80",
  "newValue": "100"
}
Expected outputjson
{
  "change": "0.25",
  "defined": true,
  "changePercent": "25"
}

Explicitly report a zero baseline as undefined

Inputjson
{
  "oldValue": "0",
  "newValue": "5",
  "zeroPolicy": "undefined"
}
Expected outputjson
{
  "defined": false
}
  • When you hold a baseline and a new value and need the relative change, including a zero-baseline policy.
  • Use in auditable fund-accounting calculations that need normalized decimal output

Avoid for

  • When you need a ratio rather than a percentage, or the baseline convention is still missing.
  • Do not use for approximate floating-point analytics or unbounded datasets

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

transformationmath