Difference between revisions of "IntToHexString"

From NWN Lexicon
Jump to: navigation, search
(Created page with " =IntToHexString(int)= This function converts an int to a string representation of the same hexadecimal value. string  IntToHexString(     [[...")
 
Line 7: Line 7:
 
This function converts an int to a string representation of the same hexadecimal value.
 
This function converts an int to a string representation of the same hexadecimal value.
  
 +
<nwscript>
 
  [[string | string ]] IntToHexString(
 
  [[string | string ]] IntToHexString(
 
      [[int | int ]] nInteger
 
      [[int | int ]] nInteger
 
  );
 
  );
 +
</nwscript>
  
 
====Parameters====
 
====Parameters====
Line 37: Line 39:
 
====Example====
 
====Example====
  
<font color="#0000ff">int</font> foo = <font color="#7f007f">300</font>;
+
<nwscript>
  <font color="#0000ff">string</font> bar =  IntToHexString(foo);
+
int foo = 300;
 +
  string bar =  IntToHexString(foo);
 +
</nwscript>
  
 
====See Also====
 
====See Also====

Revision as of 20:48, 25 August 2012



IntToHexString(int)

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

 [[string | string ]] IntToHexString(
     [[int | 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

If the first numeric system you learned was hexadecimal then these values would be useful for you. For the rest of us normal types stick to the basic string representation.


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