views:

174

answers:

4

I would like to be able to do such things as

var m1 = new UnitOfMeasureQuantityPair(123.00, UnitOfMeasure.Pounds);
var m2 = new UnitOfMeasureQuantityPair(123.00, UnitOfMeasure.Liters);

m1.ToKilograms();
m2.ToPounds(new Density(7.0, DensityType.PoundsPerGallon);

If there isn't something like this already, anybody interested in doing it as an os project?

+4  A: 

Check out the Measurement Unit Conversion Library on The Code Project.

Vinko Vrsalovic
+2  A: 

We actually built one in-house where I work. Unfortunately, it's not available for the public.

This is actually a great project to work on and it's not that hard to do. If you plan on doing something by yourself, I suggest you read about Quantity, Dimension and Unit (fundamental units).

These helped us understand the domain of the problem clearly and helped a lot in designing the library.

GoodEnough
+1  A: 

Also see the most recent F# release - it has static measurement domain/dimension analysis.

reeeehhhheeeheeallly? I've just been itching to use F#.
George Mauer
+1  A: 
rohancragg