# Fraction and decimal converter

Convert a decimal to a fraction or a fraction to a decimal, simplify a/b, and show mixed numbers.

- Endpoint: `POST https://setget.net/v1/tools/fraction` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `fraction`
- Page: https://setget.net/tools/fraction

## Inputs

- `value` (required, string): A decimal (0.75), a fraction (6/8), a mixed number (1 3/4) or a repeating decimal (0.1(6)).
- `max_denominator` (optional, integer, range 1..1000000000): Largest denominator allowed. The closest fraction within it is returned.

## Example 1

```json
{"input":{"value":"0.75"}}
```

Result:

```json
{"fraction":"3/4","numerator":3,"denominator":4,"mixed":"3/4","decimal":0.75,"decimal_text":"0.75","percent":75,"exact":true}
```

## Example 2: Simplify, with a mixed number

```json
{"input":{"value":"14/8"}}
```

Result:

```json
{"fraction":"7/4","numerator":7,"denominator":4,"mixed":"1 3/4","decimal":1.75,"decimal_text":"1.75","percent":175,"exact":true}
```

## Example 3: The closest simple fraction

```json
{"input":{"value":"3.14159","max_denominator":10}}
```

Result:

```json
{"fraction":"22/7","numerator":22,"denominator":7,"mixed":"3 1/7","decimal":3.14285714286,"decimal_text":"3.(142857)","percent":314.285714286,"exact":false}
```

**What do the brackets in "decimal_text" mean?** The digits in brackets repeat for ever: 0.(3) is 0.333... and 0.1(6) is 0.1666... You can also type a value that way.

**When is "exact" false?** When max_denominator forced an approximation. 3.14159 is exactly 314159/100000, but with a limit of 10 the closest fraction is 22/7.
