toBase - Change base of numerical value
The toBase
function will render out a string
representation of a number
.
Syntax
Arguments
Name | Type | Required | Description |
---|---|---|---|
number | number | true | The number to convert into its string representation |
radix | number | true | The base for the new stringified number. e.g hexidecimal is 16 |
Example - Converting a number to hexidecimal
Consider the following document:
If we wish to convert val
into a hex representation, we can use toBase
:
This results in the following document:
Try it yourself
Open the Explore screen in Coralogix and paste this query:
Theme
Light