Allowing Imperial Input to an Integer Database

I need to add a reversible input routine for a database containing metric integer values in the range 0-9999mm. There is no possibility of storing FP values, as this would impact on many other functions.

Input will be in the form "23 3/16". I cannot use a direct multiple, because
values are held as integers, and would not reverse back (lack of accuracy).

I have thought of mapping 160 1/16ths to 254mmm by look up table, as this would reverse, but there is a possibilty of using 1/32 accuracy. This will mean 320 1/32ths against 254 mm, which is not reversible as there would be multiple possibilities.

Has anyone solved this previously?
Topic archived. No new replies allowed.