Lua function
bit.tostring
Summary
Convert a number into a string
Prototype
s = bit.tostring (n, base)
Description
This takes a number, and converts it into a string to the given base, in uppercase. The base is optional and defaults to 10. The base can be in the range 2 to 36. Fractional parts are discarded, as the number is first converted to a 64-bit number internally. Negative numbers are OK, and will be converted with a leading "-" sign.
eg.
print (bit.tostring (45035996273, 16)) --> A7C5AC471
See Also ...
Topics
Lua base functions
Lua bc (big number) functions
Lua bit manipulation functions
Lua coroutine functions
Lua debug functions
Lua io functions
Lua math functions
Lua os functions
Lua package functions
Lua PCRE regular expression functions
Lua script extensions
Lua string functions
Lua table functions
Lua utilities
Scripting
Lua functions
bit.ashr (Shifts a number right, preserving sign)
bit.band (Bitwise 'and')
bit.bor (Bitwise 'or')
bit.mod (Bitwise 'modulus' (remainder after integer divide))
bit.neg (Bitwise negate (ones complement))
bit.shl (Shifts a number left)
bit.shr (Shifts a number right)
bit.tonumber (Convert a string into a number)
bit.xor (Bitwise 'exclusive or')
(Help topic: lua=bit.tostring)
Documentation contents page
|