How to convert binary to decimal

by Ben (no login)

 

I asked a question like this before with no answer. Here is solution if anyone interested.

1, shift to the right by \10
2, modular division by 10 to get 'ones' decimal place

DIM a AS INTEGER
DIM b AS STRING

m = 10
a = 26345
CLS

DO UNTIL a = 0
b = CHR$(48 + (a MOD 10)) + b
a = a \ 10
LOOP

PRINT b

Posted on Feb 3, 2010, 12:35 PM

Respond to this message   

Return to Index

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement