A method and apparatus for dynamically configuring a unit conversion
mechanism is provided. A non-executable data structure defines
information, which is accessed to facilitate unit conversion. The
information in the non-executable data structure is in the form of
elements, which include among other things at least one measurable
quantity, such as length or mass, along with a plurality of units, such
as feet, meters, millimeters, pounds, and kilograms. Each of the units is
associated with a measurable quantity. For example, feet, meters, and
millimeters are used in measuring length. Conversion information, which
includes an offset and a gain, is associated with each of the units. The
plurality of units, along with the conversion information, is used to
dynamically configure the unit conversion mechanism at runtime. In so
doing, the unit conversion mechanism can convert from one unit to another
unit for a measurable quantity.