##### Getting Started

Setup

Tutorials

Compatibility & Security

##### AI Features

##### Layout & Styling

Theming

##### Charting

Sparklines

Integrated Charts

Standalone Charts

##### Core Features

Columns

Rows

Cells

Filtering

Selection

Editing

Updating Data

Interactivity

##### Advanced Features

Row Grouping

Aggregation

Pivoting

Tree Data

Master Detail

Accessories

Server-Side Data

Import & Export

State & Lifecycle

Performance

## Value Parser

```ts
<ag-grid-angular
    [columnDefs]="columnDefs"
    /* other grid options ... */ />

this.columnDefs = [\
    {\
        // name is a string, so don't need to convert\
        field: 'name',\
        editable: true,\
    },\
    {\
        // age is a number, so want to convert from string to number\
        field: 'age',\
        editable: true,\
        valueParser: params => Number(params.newValue)\
    }\
];
```

|     |
| --- |
| valueParser <br>string | ValueParserFunc<br>Function or [expression](/content/angular-data-grid/cell-expressions/#column-definition-expressions/index.html). Parses the value for saving. |

Below shows an example using value parsers. The following can be noted:

- All columns are editable. After any edit, the console prints the new data for that row.
- Column 'Name' is a string column. No parser is needed.
- Column 'Bad Number' is bad because after an edit, the value is stored as a string in the data, whereas the data value should be number type.
- Column 'Good Number' is good because after an edit, the value is converted to a number using the value parser.

## Use Value Parser for Import

Using the value parser for import applies to the following features:

- [Paste](/content/angular-data-grid/clipboard/#processing-pasted-data/index.html)
- [Fill Handle](/content/angular-data-grid/cell-selection-fill-handle/index.html)
- [Copy Range Down](/content/angular-data-grid/cell-selection/#copy-cell-range-down/index.html)

Using a value parser for import is normally used in conjunction with [Using a Value Formatter for Export](/content/angular-data-grid/value-formatters/#formatting-for-export/index.html), where a [Value Formatter](/content/angular-data-grid/value-formatters/index.html) is defined that does the reverse of the value parser.
