Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- GT_LIB v1.0 Reference Guide Release 1.0 - <b>turns a decimal integer into a base36 number</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Turns a decimal integer into a Base36 number
------------------------------------------------------------------------------

 Syntax

        GT_DtoB36(<n> [,nLength]) --> <cB36Num>

 Arguments:

      <n>       is a decimal integer

      <nLength> is a MINIMUM length string to return.
                If passed, this will cause the return value to be
                padded with leading zero's to the length specified.
                If the string is longer than <nLength>, it is not truncated.

                If omitted, the return value is 'trimmed'.

 Returns:

      <cB36Num> is a character string representing a Base36 number.

 Description:

      This turns a decimal number into a Base36 number, represented by a
      string.  Large numbers can be stored in a very few bytes, so this is
      ideal for lookup table ID's, file offsets etc.

 Examples:

      ? GT_DtoB36(12)        // 'C'

      ? GT_DtoB36(1679615)   // 'ZZZZ'

      ? GT_DtoB36(1679615,5) // '0ZZZZ'

      ? GT_DtoB36(1679615,3) // 'ZZZZ'

 Source: GTMATH06.PRG

 Author:  Philip Ide

See Also: GT_B36TOD()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson