C program - convert values based on the position

Hey!

I'm new to C. I need to covert certain values using C. please see the below. I have figured out the logic to do it. Please provide some hints to do this with C

Logic:

If first position of POS = 0, shift POS to the left one byte.
If third position of POS = 0, move spaces to third position of POS
If third position of POS = 5, change third position of POS to two positions of ".5"

This          Becomes this
010                  1
015                  1.5
02R                  2R
060                   6
065                   6.5
100                   10
105                   10.5
110                   11
115                   11.5
11R                   11R

Is this homework?