Home Contents | # string.mki | String | Core4 Lua Commands

## SYNOPSIS

1. str = string.mki(value)
2. str = string.mkin(value)
3. str = string.mkl(value)
4. str = string.mkln(value)

## DESCRIPTION

Thes functions convert a numeric value into a string.

string.mki() returns the value converted into a little-endian 16-bit byte-sequence. It is equivalent to string.char(value) .. string.char(value >> 8).

string.mkin() is the big endian variant of string.mki(). It is equivalent to string.char(value >> 8) .. string.char(value).

string.mkl() returns the value converted into a little-endian 16-bit byte-sequence. It is equivalent to string.char(value) .. string.char(value >> 8) .. string.char(value >> 16) .. string.char(value >> 24).

string.mkln() is the big endian variant of string.mkl(). It is equivalent to string.char(value >> 24) .. string.char(value >> 16) .. string.char(value >> 8) .. string.char(value).

## RETURN VALUE

A string of two or four bytes length.

## EXAMPLE

>
print(string.mki(0x1234):tohex())
3412

## SEE ALSO

string.cvi, string.cvin, string.cvl, string.cvln