Difference between revisions of "Bit.tohex"
From GiderosMobile
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | '''Available since:''' Gideros 2013.09<br/> | + | '''<translate>Available since</translate>:''' Gideros 2013.09<br/> |
− | === Description === | + | === <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"> | <source lang="lua"> | ||
(string) = bit.tohex(x,n) | (string) = bit.tohex(x,n) | ||
</source> | </source> | ||
− | === Parameters === | + | === <translate>Parameters</translate> === |
'''x''': (number) <translate>number to convert to hex string</translate> <br/> | '''x''': (number) <translate>number to convert to hex string</translate> <br/> | ||
'''n''': (number) <translate>number of hex digits to convert</translate> '''optional'''<br/> | '''n''': (number) <translate>number of hex digits to convert</translate> '''optional'''<br/> | ||
− | === Return values === | + | === <translate>Return values</translate> === |
− | '''Returns''' (string) <translate>hex string</translate><br/> | + | '''<translate>Returns</translate>''' (string) <translate>hex string</translate><br/> |
Revision as of 07:26, 24 August 2018
Available since: Gideros 2013.09
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.
(string) = bit.tohex(x,n)
Parameters
x: (number) number to convert to hex string
n: (number) number of hex digits to convert optional
Return values
Returns (string) hex string