---
product: "AG Grid"
title: "Number Cell Editor"
description: "Simple number editor that uses the standard HTML number input ."
framework: vue
version: "36.2.0"
related:
    - title: "Text Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/vue-data-grid/provided-cell-editors-text/"
    - title: "Large Text Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/vue-data-grid/provided-cell-editors-large-text/"
    - title: "Date Editors"
      url: "https://www.ag-grid.com/archive/36.2.0/vue-data-grid/provided-cell-editors-date/"
    - title: "Checkbox Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/vue-data-grid/provided-cell-editors-checkbox/"
    - title: "Select Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/vue-data-grid/provided-cell-editors-select/"
    - title: "Rich Select Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/vue-data-grid/provided-cell-editors-rich-select/"
llms: "https://www.ag-grid.com/archive/36.2.0/llms.txt"
---

# Number Cell Editor

Simple number editor that uses the standard HTML number `input`.

The Number Cell Editor allows users to enter numeric values and to modify them using the `↑` `↓` keys.

## Enabling Number Cell Editor

Edit any cell in the grid below to see the Number Cell Editor.

#### Number Editor

```ts
import {
  createApp,
  defineComponent,
  onBeforeMount,
  ref,
  shallowRef,
} from "vue";
import { AgGridVue } from "ag-grid-vue3";
import {
  ClientSideRowModelModule,
  ColDef,
  ColGroupDef,
  GridApi,
  GridOptions,
  GridReadyEvent,
  INumberCellEditorParams,
  ModuleRegistry,
  NumberEditorModule,
  enableDevValidations,
} from "ag-grid-community";

if (process.env.NODE_ENV !== "production") {
  // Enable extended validations only for development
  enableDevValidations();
}

ModuleRegistry.registerModules([ClientSideRowModelModule, NumberEditorModule]);

const data = Array.from(Array(20).keys()).map((val: any, index: number) => ({
  number: index,
}));

const VueExample = defineComponent({
  template: `
        <div style="height: 100%">
                <ag-grid-vue
      style="width: 100%; height: 100%;"
      @grid-ready="onGridReady"
      :columnDefs="columnDefs"
      :defaultColDef="defaultColDef"
      :rowData="rowData"></ag-grid-vue>
        </div>
    `,
  components: {
    "ag-grid-vue": AgGridVue,
  },
  setup(props) {
    const gridApi = shallowRef<GridApi | null>(null);
    const columnDefs = ref<ColDef[]>([
      {
        headerName: "Number Editor",
        field: "number",
        cellEditor: "agNumberCellEditor",
        cellEditorParams: {
          min: 0,
          max: 100,
        } as INumberCellEditorParams,
      },
    ]);
    const defaultColDef = ref<ColDef>({
      width: 200,
      editable: true,
    });
    const rowData = ref<any[] | null>(data);

    const onGridReady = (params: GridReadyEvent) => {
      gridApi.value = params.api;
    };

    return {
      gridApi,
      columnDefs,
      defaultColDef,
      rowData,
      onGridReady,
    };
  },
});

const app = createApp(VueExample);
app.mount("#app");
```

[Live example: Number Editor](https://www.ag-grid.com/archive/36.2.0/examples/provided-cell-editors-number/number-editor/vue3/)

Enabled with `agNumberCellEditor` and configured with `INumberCellEditorParams`.

```js
columnDefs: [
    {
        cellEditor: 'agNumberCellEditor',
        cellEditorParams: {
            min: 0,
            max: 100
        }
        // ...other props
    }
]
```

## Customisation

### Step and Precision

It is possible to configure the step and precision of the stepping behaviour that increments/decrements the cell value. Edit any cell in the grid below to see a customised stepping behaviour.

#### Number Editor with Changed Precision

```ts
import {
  createApp,
  defineComponent,
  onBeforeMount,
  ref,
  shallowRef,
} from "vue";
import { AgGridVue } from "ag-grid-vue3";
import {
  ClientSideRowModelModule,
  ColDef,
  ColGroupDef,
  GridApi,
  GridOptions,
  GridReadyEvent,
  INumberCellEditorParams,
  ModuleRegistry,
  NumberEditorModule,
  enableDevValidations,
} from "ag-grid-community";

if (process.env.NODE_ENV !== "production") {
  // Enable extended validations only for development
  enableDevValidations();
}

ModuleRegistry.registerModules([ClientSideRowModelModule, NumberEditorModule]);

const data = Array.from(Array(20).keys()).map((val: any, index: number) => ({
  number: index,
}));

const VueExample = defineComponent({
  template: `
        <div style="height: 100%">
                <ag-grid-vue
      style="width: 100%; height: 100%;"
      @grid-ready="onGridReady"
      :columnDefs="columnDefs"
      :defaultColDef="defaultColDef"
      :rowData="rowData"></ag-grid-vue>
        </div>
    `,
  components: {
    "ag-grid-vue": AgGridVue,
  },
  setup(props) {
    const gridApi = shallowRef<GridApi | null>(null);
    const columnDefs = ref<ColDef[]>([
      {
        headerName: "Number Editor",
        field: "number",
        cellEditor: "agNumberCellEditor",
        cellEditorParams: {
          precision: 2,
          step: 0.25,
          showStepperButtons: true,
        } as INumberCellEditorParams,
      },
    ]);
    const defaultColDef = ref<ColDef>({
      width: 200,
      editable: true,
    });
    const rowData = ref<any[] | null>(data);

    const onGridReady = (params: GridReadyEvent) => {
      gridApi.value = params.api;
    };

    return {
      gridApi,
      columnDefs,
      defaultColDef,
      rowData,
      onGridReady,
    };
  },
});

const app = createApp(VueExample);
app.mount("#app");
```

[Live example: Number Editor with Changed Precision](https://www.ag-grid.com/archive/36.2.0/examples/provided-cell-editors-number/number-editor-step-and-precision/vue3/)

The stepping behaviour to increment/decrement the numeric value can be customised using the properties below:

```js
columnDefs: [
    {
        cellEditor: 'agNumberCellEditor',
        cellEditorParams: {
            precision: 2,
            step: 0.25,
            showStepperButtons: true
        }
        // ...other props
    }
]
```

### Prevent Stepping

The stepping behaviour can be disabled. Edit any cell in the grid below to see this.

#### Number Editor with Prevent Stepping

```ts
import {
  createApp,
  defineComponent,
  onBeforeMount,
  ref,
  shallowRef,
} from "vue";
import { AgGridVue } from "ag-grid-vue3";
import {
  ClientSideRowModelModule,
  ColDef,
  ColGroupDef,
  GridApi,
  GridOptions,
  GridReadyEvent,
  INumberCellEditorParams,
  ModuleRegistry,
  NumberEditorModule,
  enableDevValidations,
} from "ag-grid-community";

if (process.env.NODE_ENV !== "production") {
  // Enable extended validations only for development
  enableDevValidations();
}

ModuleRegistry.registerModules([ClientSideRowModelModule, NumberEditorModule]);

const data = Array.from(Array(20).keys()).map((val: any, index: number) => ({
  number: index,
}));

const VueExample = defineComponent({
  template: `
        <div style="height: 100%">
                <ag-grid-vue
      style="width: 100%; height: 100%;"
      @grid-ready="onGridReady"
      :columnDefs="columnDefs"
      :defaultColDef="defaultColDef"
      :rowData="rowData"></ag-grid-vue>
        </div>
    `,
  components: {
    "ag-grid-vue": AgGridVue,
  },
  setup(props) {
    const gridApi = shallowRef<GridApi | null>(null);
    const columnDefs = ref<ColDef[]>([
      {
        headerName: "Number Editor",
        field: "number",
        cellEditor: "agNumberCellEditor",
        cellEditorParams: {
          preventStepping: true,
        } as INumberCellEditorParams,
      },
    ]);
    const defaultColDef = ref<ColDef>({
      width: 200,
      editable: true,
    });
    const rowData = ref<any[] | null>(data);

    const onGridReady = (params: GridReadyEvent) => {
      gridApi.value = params.api;
    };

    return {
      gridApi,
      columnDefs,
      defaultColDef,
      rowData,
      onGridReady,
    };
  },
});

const app = createApp(VueExample);
app.mount("#app");
```

[Live example: Number Editor with Prevent Stepping](https://www.ag-grid.com/archive/36.2.0/examples/provided-cell-editors-number/number-editor-prevent-stepping/vue3/)

The stepping behaviour to increment/decrement the numeric value can be disabled as shown below:

```js
columnDefs: [
    {
        cellEditor: 'agNumberCellEditor',
        cellEditorParams: {
            preventStepping: true
        }
        // ...other props
    }
]
```

## API Reference

Properties available on the `INumberCellEditorParams&lt;TData = any, TContext = any&gt;` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `min` | `number` |  |  |  |
| `max` | `number` |  |  |  |
| `precision` | `number` |  |  |  |
| `step` | `number` |  |  |  |
| `showStepperButtons` | `boolean` |  |  |  |
| `preventStepping` | `boolean` |  |  |  |
