Skip to content

Best practices for working with dynamic units? #587

Closed
@Mobz87

Description

@Mobz87

I'm working on a program where the customer wants to be able to change the 'default units'.

ex
In a Settings-tab:
Pressure (choose) Bar or Pascal.
If you select 'Bar' then all input and output are displayed in Bar.

Right now I have hard coded it like:

Pressure = Pressure.FromBars(Control.Value);

OutputBox = Pressure.ToUnit(PressureUnit.Bar).ToString();

What is Best practices for making dynamic units?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions