IntToHexString

From NWN Lexicon
Revision as of 13:51, 29 May 2020 by Jasperre (talk | contribs) (bitwise stuff)
Jump to: navigation, search



IntToHexString(int)

This function converts an int to a string representation of the same hexadecimal value.

string IntToHexString(
    int nInteger
);

Parameters

nInteger

The integer to convert to hexadecimal (base 16).


Description

This function coverts an integer to a hexadecimal string representation of the same value, so that converting 123 to a hexString would yield "0x0000007b".



Remarks

The main use of this is for more easily debugging bitwise operations on integers. Hexidecimal can define values for bitwise operations more easily. See int and Bitwise Operators for more inforamtion.


Version

1.30

Example

int foo = 300;
string bar =  IntToHexString(foo);

See Also

functions: 

IntToString



 author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul