Skip to main content

hex (Function)

This function wraps the java.lang.Double.toHexString() function. It returns a hexadecimal string representation of the input, p1`.

Syntax

<STRING> math:hex(<INT|LONG|FLOAT|DOUBLE> p1)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
p1The value of the parameter whose hexadecimal value should be found.INT LONG FLOAT DOUBLENoYes

Example 1

CREATE STREAM InValueStream (inValue int);

@info(name = 'convertToHexString')
INSERT INTO OutMediationStream
SELECT math:hex(inValue) AS hexString
FROM InValueStream;

The query converts the provided inValue from the InValueStream into its corresponding hexadecimal format using the math:hex() function. The result is directed to the output stream OutMediationStream. For example, hex(200) returns "c8".