Re: Question About Z-Level Number Thingie
- Posted by Colin Taylor <cetaylor at COMPUSERVE.COM> Dec 07, 1999
- 356 views
C. K. Lester wrote: >I want to be able to use what I am temporarily calling "Z-Level" numbering, >where it's like hexadecimal but it uses the whole alphabet (up to 'Z', y= ou >see). Whereas hexadecimal stops at F=3D15, z-decimal stops at Z =3D 36 (starting >with 0=3D0 and workin' yer way up). > Actually, Z would be 35 I don't know if Lucius' suggestion helped you, but here is a short functi= on which converts a decimal integer to any base between 2 and 36... sequence char, out_str char =3D "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" out_str =3D "" function convert_base(integer num, integer base) if num >=3D base then out_str =3D convert_base(floor(num/base), base) & char[remainder(= num, base)+1] else out_str &=3D char[num+1] end if return out_str end function - Colin