Binary to Decimal

BlitzMax Forums/BlitzMax Beginners Area/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.

Let BMax do all the hard work for you...
Local binary$ = "10101010"

Print Int("%" + binary$)

Print BinToDec("10101010")

End

Function BinToDec(binary$)
	If binary$[0] <> 37 Then binary$ = "%" + binary$
	
	Return Int(binary$)
End Function