Shop
OBEX
P1 Docs
P2 Docs
Learn
Events
Binary to decimal conversion — Parallax Forums
toggle menu
Categories
Discussions
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Sign In
·
Register
×
Home
›
BASIC Stamp
Binary to decimal conversion
DrAnalog
Posts:
4
2008-03-26 18:27
edited 2008-03-27 14:18
in
BASIC Stamp
Does anyone have a routine in PBasic that will convert binary to decimal, or give me an idea where to start looking?
Comments
Franklin
Posts:
4,747
2008-03-26 22:26
edited 2008-03-26 22:26
All numbers are stored as binary try debug dec x where x is your binary number.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Mike Green
Posts:
23,101
2008-03-26 22:30
edited 2008-03-26 22:30
If you only want the decimal representation for display purposes, use the DEC formatter as Franklin suggested.
If you want it for something else, you'll need to give more information about your needs. Do look at the DIG operator
in the Basic manual.
DrAnalog
Posts:
4
2008-03-27 14:18
edited 2008-03-27 14:18
Thank you very much. The DIG directive is exactly what I needed.
Klaus
Sign In
or
Register
to comment.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
If you want it for something else, you'll need to give more information about your needs. Do look at the DIG operator
in the Basic manual.
Klaus