Shop OBEX P1 Docs P2 Docs Learn Events
Displaying a floating point Number — Parallax Forums

Displaying a floating point Number

TWilsonTWilson Posts: 8
edited 2011-03-09 10:42 in BASIC Stamp
Hi,
Even though the BS2 cannot do floating point numbers, can you display a number with a decimal point using some type of formatting with the DEBUG command?
Thanks...

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-09 10:30
    Yes. For example, say you're using scaled integer numbers with two decimal places and ranging from 0.00 to 655.35 in value (16-bit unsigned arithmetic). You could display the value like this:

    DEBUG DEC value/100, ".", DEC2 value//100
  • TWilsonTWilson Posts: 8
    edited 2011-03-09 10:42
    That's exactly what I was looking for.
    Thanks Mike!
Sign In or Register to comment.