, , Units, Units.Torque Units.Length.
If you create a class of type Units.Weight and have all the conversion factors as constant values and possible units as an enumeration, you can simply call this class and convert it to the desired units. This is a very simple example of the system we use:
namespace Units
{
class Weight
{
public enum WeightType
{
kg,
lb
}
const double kgTolbs = 2.20462262;
public static double Convert(double value, WeightType fromUnits, WeightType toUnits)
{
}
}
}
With this structure you can convert to any type of device at any time.
source
share