Re: Question About Z-Level Number Thingie
- Posted by cklester <cklester at HOTPOP.COM> Dec 07, 1999
- 348 views
Dude, you rock! Thanks. I guess I should test the code before I sing your praises, but I have faith. Thanks, again! < |< ------------------- Your original post: > I don't know if Lucius' suggestion helped you, but here is a > short function > which converts a decimal integer to any base between 2 and 36... > > sequence char, out_str > char = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" > out_str = "" > > function convert_base(integer num, integer base) > if num >= base then > out_str = convert_base(floor(num/base), base) & > char[remainder(num, > base)+1] > else > out_str &= char[num+1] > end if > return out_str > end function > > - Colin >