Difference between revisions of "Bit.tohex"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
 
<translate>Converts its first argument to a hex string. The number of hex digits is given by the absolute value of the optional second argument. Positive numbers between 1 and 8 generate lowercase hex digits. Negative numbers generate uppercase hex digits. Only the least-significant 4*|n| bits are used. The default is to generate 8 lowercase hex digits.</translate>
 
<translate>Converts its first argument to a hex string. The number of hex digits is given by the absolute value of the optional second argument. Positive numbers between 1 and 8 generate lowercase hex digits. Negative numbers generate uppercase hex digits. Only the least-significant 4*|n| bits are used. The default is to generate 8 lowercase hex digits.</translate>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(string) = bit.tohex(x,n)
 
(string) = bit.tohex(x,n)
 
</source>
 
</source>

Revision as of 14:26, 13 July 2023


Available since: Gideros 2013.09
Class: bit

Description

Converts its first argument to a hex string. The number of hex digits is given by the absolute value of the optional second argument. Positive numbers between 1 and 8 generate lowercase hex digits. Negative numbers generate uppercase hex digits. Only the least-significant 4*|n| bits are used. The default is to generate 8 lowercase hex digits. <syntaxhighlight lang="lua"> (string) = bit.tohex(x,n) </source>

Parameters

x: (number) number to convert to hex string
n: (number) number of hex digits to convert optional

Return values

Returns (string) hex string