BBS: Inland Empire Archive
Date: 03-19-92 (14:31) Number: 144
From: RICK PEDLEY Refer#: NONE
To: KEVIN NEWELL Recvd: NO
Subj: Number Conversions Conf: (2) Quik_Bas
On 03-16-92 KEVIN NEWELL wrote to All...
KN> I am looking for a quickie and easy way to convert decimal
KN> to base 36 I have seen some code in the past, but I can not
KN> find it...
N = 0
INPUT "From Base, To Base, Number: ", A, B, N$
FOR M = 1 TO LEN(N$)
C = ASC(MID$(N$, M, 1)) - 48
N = N * A - (C > 9) * (C - 7) - (C < 10) * C
C = 0: N$ = ""
FOR M = 1 TO 0 STEP -1
C = C + 1
D! = N / B ^ C + .0001
M = INT(D!)
R = INT((D! - M) * B)
N$ = CHR$(-(R < 10) * (R + 48) - (R > 9) * (R + 55)) + N$
... OFFLINE 1.36 * Moving fast is not the same as going somewhere.
--- Maximus 2.01wb
* Origin: The BULLpen BBS * Intel 14.4EX (613)549-5168 (1:249/140)