Closed
Description
I am looking for an API to convert from one unit system to another. I expect I have not found the correct API?
What I would expect to see is:
var value = 1.0;
var inputSystem = new UnitSystem(new BaseUnits(....));
var siValue = Length.From(value, inputSystem).As(UnitSystem.SI);
I'm not entirely sure what the purpose of the nullable unit types for a given system are. My current code looks like:
var value = 1.0;
var inputSystem = new UnitSystem(new BaseUnits(....));
va siValue = Length.From(value, inputSystem.BaseUnits.Length!.Value).As(UnitSystem.SI);
however this does not extend so well to things like Pressure.
var value = 1.0;
var inputSystem = new UnitSystem(new BaseUnits(....));
va siValue = Pressure.From(value, ???).As(UnitSystem.SI);