Shop OBEX P1 Docs P2 Docs Learn Events
Decimal value — Parallax Forums

Decimal value

WILLQHWILLQH Posts: 11
edited 2006-01-18 04:00 in Learn with BlocklyProp
Hii

Is there a simple code where i can use to display the reading i obtain up to 2 decimal places ? or·is only·integer values·allowed ?

Regards

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-18 04:00
    Only integers. But if you use a word variable that represents units of 1/100, you can have a value up to 655.35. If you're using a BS2, you can display the value in the Debug Window like this:

    DEBUG DEC (myVal / 100), ".", DEC2 myVal

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.