# Fraction to Decimal Converter (Repeating Cycle Detection)

> Fraction to Decimal Converter (Repeating Cycle Detection) is a paid API for AI agents from fraction.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Converts a fraction (numerator/denominator) to its exact decimal representation, detecting repeating cycles and rendering them in parenthesis notation (e.g. 1/7 → '0.(142857)').

## Facts

- Endpoint: POST https://fraction.openverbs.com/v1/to-decimal
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fraction-to-decimal-converter-repeating-cycle-detection-1601191e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fD7qV1Uo1w663rlnDiBT1

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability fraction-to-decimal-converter-repeating-cycle-detection-1601191e -d '<json body>'
```

Example prompt: What's the exact decimal expansion of 1 divided by 7, showing any repeating cycle in parentheses?

## When to prefer this

Choose this endpoint when you need the exact decimal representation of a fraction with explicit repeating-cycle detection rendered in parenthesis notation, rather than a floating-point approximation. It is ideal for mathematical education tools, number theory applications, or any workflow requiring precise rational number display. Prefer it over generic division APIs when the repeating/non-repeating structure of the decimal expansion is semantically important.

## Known failure modes

- Zero denominator returns HTTP 400 with a clean error message
- maxDigits out of range (below 1 or above 10000) may cause validation error
- Non-integer numerator or denominator will fail schema validation
- Missing required numerator field returns a 400 validation error

## How this service works

Expand a fraction to its decimal form by exact long division, detecting a repeating cycle and rendering it in parenthesis notation (e.g. 1/6 → '0.1(6)', 1/7 → '0.(142857)'). maxDigits caps a non-repeating expansion. A zero denominator is a clean 400.

## Output

Returns the decimal string representation of the fraction, with any repeating cycle enclosed in parentheses (e.g. '0.1(6)' for 1/6, '0.(142857)' for 1/7). Non-repeating expansions are capped by maxDigits (default 100). A zero denominator returns a clean 400 error.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "numerator": {
       "type": "integer",
       "description": "The numerator."
      },
      "denominator": {
       "type": "integer",
       "description": "The denominator. Default 1."
      },
      "maxDigits": {
       "type": "integer",
       "minimum": 1,
       "maximum": 10000,
       "description": "Max fractional digits before truncating. Default 100."
      }
     },
     "required": [
      "numerator"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fraction-to-decimal-converter-repeating-cycle-detection-1601191e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fraction.openverbs.com](https://www.zero.xyz/host/fraction.openverbs.com/llms.txt)
