Shop OBEX P1 Docs P2 Docs Learn Events
Binary to decimal conversion — Parallax Forums

Binary to decimal conversion

DrAnalogDrAnalog Posts: 4
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

  • FranklinFranklin Posts: 4,747
    edited 2008-03-26 22:26
    All numbers are stored as binary try debug dec x where x is your binary number.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Mike GreenMike Green Posts: 23,101
    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.
  • DrAnalogDrAnalog Posts: 4
    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.