Is this correct ?
The math is correct. If you want to know if you chose the right algorithm, you have to tell us, where you get the values from and what you want to achieve.
What code are you using?
I tried to understand why there is 10 bits in the code for CTRL_REG4, and not 8 bits as I asumed there should be when I look on the datasheet, you know why ?