{"uid":"cap_2pdYvkK97mCTmOJnIeIfb","slug":"fraction-from-decimal-converter-258d0061","name":"Fraction from Decimal Converter","description":"Convert a decimal string to an exact reduced fraction. For a repeating decimal, set repeat to the number of trailing fractional digits that repeat (e.g. value='0.1666', repeat=1 → 1/6; value='0.3', repeat=1 → 1/3). A non-numeric value is a clean 400.","url":"https://fraction.openverbs.com/v1/from-decimal","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["value"],"properties":{"value":{"type":"string","maxLength":1024,"minLength":1,"description":"Decimal number as a string, e.g. '0.75' or '-3.5'."},"repeat":{"type":"integer","maximum":1024,"minimum":0,"description":"Count of trailing fractional digits that repeat. Default 0 (terminating)."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_6GCNpmMcQSLWl-1YL1i95","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts a decimal string (including repeating decimals) to its exact reduced fraction form","exampleAgentPrompt":"Can you convert the repeating decimal 0.1666 to an exact reduced fraction? The last 1 digit repeats.","exampleUseCases":[{"title":"Exact fraction from repeating decimal","prompt":"I have the decimal 0.3 with the last digit repeating — what is that as an exact reduced fraction?"},{"title":"Simplify terminating decimal to fraction","prompt":"Convert 0.625 to a fraction in its simplest form, no repeating digits."},{"title":"Negative decimal to fraction","prompt":"What is -3.5 expressed as a reduced fraction?"}],"resultDescription":"Returns the exact reduced fraction representation of the input decimal, expressed as a numerator and denominator in lowest terms. For repeating decimals, the repeat parameter ensures the mathematically exact rational equivalent is computed (e.g. 0.1666 with repeat=1 yields 1/6).","failureModes":["Non-numeric string value returns a clean HTTP 400 error","Missing required 'value' field returns a validation error","repeat count exceeding 1024 or below 0 returns a validation error","value string longer than 1024 characters returns a validation error"],"whenToPreferThis":"Use this endpoint when you need the exact rational fraction equivalent of a decimal number, especially for repeating decimals where floating-point arithmetic would lose precision. Prefer this over manual computation or general-purpose math libraries when you need a guaranteed reduced result for a single decimal conversion without setting up any math environment.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:34:22.267Z","isFirstParty":false}