hex: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function hex== Returns a string which contains the hexadecimal representation of the number that was passed in. ===Usage=== <source lang="mtmacro" line> [h: hexVal = hex(num) </source> ...)
 
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Function hex==
{{MacroFunction
|name=hex
|description=
Returns a string which contains the hexadecimal representation of the number that was passed in.
Returns a string which contains the hexadecimal representation of the number that was passed in.


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


 
|examples=
===Examples===
<syntaxhighlight lang="mtmacro" line>
<source 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]]

Latest revision as of 16:19, 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.