> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/gradio-app/gradio/llms.txt
> Use this file to discover all available pages before exploring further.

# Number

> Create numeric input components in Gradio

The Number component creates a numeric input field for entering and displaying numbers.

## Basic usage

```python theme={null}
import gradio as gr

def double(num):
    return num * 2

gr.Interface(fn=double, inputs=gr.Number(), outputs=gr.Number()).launch()
```

## Constructor

<ParamField path="value" type="float | Callable | None" default="None">
  Default value. If None, component shows placeholder or 0
</ParamField>

<ParamField path="label" type="str | None" default="None">
  Label displayed above the component
</ParamField>

<ParamField path="placeholder" type="str | None" default="None">
  Placeholder hint text
</ParamField>

<ParamField path="precision" type="int | None" default="None">
  Precision for rounding. If 0, converts to int. If None, no rounding
</ParamField>

<ParamField path="minimum" type="float | None" default="None">
  Minimum allowed value. Raises error if user provides smaller value
</ParamField>

<ParamField path="maximum" type="float | None" default="None">
  Maximum allowed value. Raises error if user provides larger value
</ParamField>

<ParamField path="step" type="float" default="1">
  Increment step for the number
</ParamField>

<ParamField path="interactive" type="bool | None" default="None">
  Whether the number field is editable
</ParamField>

## Events

* **change** - Triggered when value changes
* **input** - Triggered on every keystroke
* **submit** - Triggered when Enter is pressed
* **focus** - Triggered when component gains focus
* **blur** - Triggered when component loses focus

## Examples

### With validation

```python theme={null}
import gradio as gr

gr.Number(
    label="Age",
    minimum=0,
    maximum=120,
    precision=0,
    value=25
)
```

### With precision

```python theme={null}
import gradio as gr

gr.Number(
    label="Price",
    precision=2,  # 2 decimal places
    value=19.99
)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.