Converting from binary to decimal

Blitz3D Forums/Blitz3D Beginners Area/Converting from binary to decimal

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Ok, part of my code involves using memory banks.

At one point, I use PeekByte to get a value from the bank. I then use Str and Bin$ in succession to convert this to an 8-bit binary number.

Say, for example, this number is 10011011, stored in the variable a$.

Using Left$(a$,4) I can get the first four binary digits "1001".

How can I then convert this 4 digit binary number to decimal?