Quote Originally Posted by pedja089 View Post
Try to use DIV32.
Code:
Dummy VAR WORD
Number VAR BYTE
Result VAR BYTE
Dummy = Number * 1000
Result=DIV32 4474
Make sure I have this right.

By defineing Result at a byte, this will round the result to byte lenght ?

Lets say I need a decimal like .0004
Would I need several lines of code or can I just use

Dec1 VAR WORD
Result VAR BYTE
Something VAR WORD

Dec1=1/2500 'this should be .0004 ' will this work ? or need DIV32
Result = Something * Dec1 ' something being between 0 and 500

Result is now rounded ?

Do I alway need a DIV32 when a want a decimal result ?