hex: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Added MacroFunction template and Mathematical Function category)
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 5: Line 5:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: hexVal = hex(num)
[h: hexVal = hex(num)
</source>
</syntaxhighlight>


|examples=
|examples=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: hex(23)]
[r: hex(23)]
</source>
</syntaxhighlight>
Returns 0x17.
Returns 0x17.


<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: hex(10)]
[r: hex(10)]
</source>
</syntaxhighlight>
Returns 0xA.
Returns 0xA.
}}
}}
[[Category:Mathematical Function]]
[[Category:Mathematical Function]]

Latest revision as of 23:59, 15 March 2023

hex() Function

Returns a string which contains the hexadecimal representation of the number that was passed in.

Usage

[h: hexVal = hex(num)

Examples

[r: hex(23)]

Returns 0x17.

[r: hex(10)]
Returns 0xA.