Skip to content

Add API to for From UnitSystem #1271

Description

@holmes-mike

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:

varvalue=1.0;varinputSystem=newUnitSystem(newBaseUnits(....));varsiValue=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:

varvalue=1.0;varinputSystem=newUnitSystem(newBaseUnits(....));vasiValue=Length.From(value,inputSystem.BaseUnits.Length!.Value).As(UnitSystem.SI);

however this does not extend so well to things like Pressure.

varvalue=1.0;varinputSystem=newUnitSystem(newBaseUnits(....));vasiValue=Pressure.From(value,???).As(UnitSystem.SI);

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions