Skip to content

chr - Convert numeric Unicode into String

The chr function will convert a number, corresponding to a Unicode codepoint value, and render it out as a string.

Syntax

Like many functions in DataPrime, chr supports two notations, function and method notation. These interchangeable forms allow flexibility in how you structure expressions.

chr(number: number): string
number: number.chr(): string

Arguments

NameTypeRequiredDescription
numbernumbertrueThe numeric value to convert to its corresponding unicode value

Example - Rendering encoded non-standard characters

Consider the following document:

{
    "emoji_numeric_value": 10084
}

We can take the numeric value and render it in its true unicode form:

create emoji_value from chr(emoji_numeric_value)
create emoji_value from emoji_numeric_value.chr()

This will result in a document that looks like this:

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