removing digits?
teganburns
Posts: 134
I need help removing the last two digits received from a sensor efficiently as possible.
For example I am receiving a value from my accelerometer and the last two digits are insignificant for my program. (value received = 16,578 .... 78 is insignificant)
the number go as low as a few hundred, and max around 65,000.
I tried using the bitwise shift right for this ( >>) but it didn't seem to get the job done.
Any ideas would be great! :thumb:
For example I am receiving a value from my accelerometer and the last two digits are insignificant for my program. (value received = 16,578 .... 78 is insignificant)
the number go as low as a few hundred, and max around 65,000.
I tried using the bitwise shift right for this ( >>) but it didn't seem to get the job done.
Any ideas would be great! :thumb:
Comments
or
value := (value + 50) / 100 ' round off