toBase
Description
Converts a number into its string representation in a specified base.
For example, converting 10
into base 16
results in "a"
.
Syntax
Like many functions in DataPrime, toBase
supports two notations, function and method notation. These interchangeable forms allow flexibility in how you structure expressions.
Arguments
Name | Type | Required | Description |
---|---|---|---|
number | number | true | The number to convert |
radix | number | true | The base for the conversion (e.g. 16 for hexadecimal) |
Example
Use case: Convert numbers to hexadecimal
Transform a decimal value into a hexadecimal string for representation or further processing.
Output
Theme
Light