Shop OBEX P1 Docs P2 Docs Learn Events
propeller get the sensor data showin the C# ? - Page 2 — Parallax Forums

propeller get the sensor data showin the C# ?

2»

Comments

  • ggg558877ggg558877 Posts: 40
    edited 2012-11-01 07:41
    hi Mike
    i find my value have minus
    how can i padding just like
    -10 = -010 , -1=-001 ?
    thanks
  • Mike GMike G Posts: 2,702
    edited 2012-11-01 12:25
    It would work pretty much the same except we have one more byte to indicate the sign.

    How about posting the source code you have tried.
  • ggg558877ggg558877 Posts: 40
    edited 2012-11-01 20:04
    hi Mike
    it my code
    value:=-10
      if (value < 0)
         value:=||value
          term.char("-")
      if(value < 10)
        term.char("0")
      if(value < 100)
        term.char("0")
      term.dec(value)
      term.str(string("   ")) 
    

    thanks
  • Mike GMike G Posts: 2,702
    edited 2012-11-02 07:30
    Looks like the posted code fulfills your request in post 32, good job.
Sign In or Register to comment.