For what it's worth, in my experiences, using IF THEN commands compile to a smaller file size than using the CASE command. That said, I would use a lookup table as Darrel provided an example.

What sensor are you using?