# `codepoint`

## Description

Converts a Unicode character into its numeric code point representation.

## Syntax

Like many functions in DataPrime, `codepoint` supports [two notations](https://coralogix.com/docs/dataprime/language-reference/functions-reference/index.md), **function** and **method** notation. These interchangeable forms allow flexibility in how you structure expressions.

```dataprime
codepoint(value: string): number
```

```dataprime
(value: string).codepoint(): number
```

## Arguments

| Name  | Type   | Required | Description                                                |
| ----- | ------ | -------- | ---------------------------------------------------------- |
| value | string | **true** | The Unicode character to convert into a numeric code point |

## Example

**Convert a Unicode character into its numeric representation**

Using `codepoint`, the character can be translated into its numeric value. Consider the following document:

### Example data

```json
{
    "emoji_value": "❤"
}
```

### Example query

```dataprime
create emoji_numeric_value from codepoint(emoji_value)
```

```dataprime
create emoji_numeric_value from emoji_value.codepoint()
```

### Example output

```json
{
    "emoji_value": "❤",
    "emoji_numeric_value": 10084
}
```
