Exemplo n.º 1
0
        public double GetValueInUnits(PressureUnits units)
        {
            switch (units)
            {
            case PressureUnits.Kpa:
                return(InKpa);

            case PressureUnits.Atmosphere:
                return(InAtmospheres);

            case PressureUnits.Bar:
                return(InBars);

            case PressureUnits.Psi:
                return(InPsi);
            }
            throw new ArgumentException("Unable to return value in" + units.ToString());
        }
Exemplo n.º 2
0
        public string GetValueInUnits(PressureUnits units, int decimalPlaces)
        {
            switch (units)
            {
            case PressureUnits.Kpa:
                return(InKpa.ToString($"F{decimalPlaces}"));

            case PressureUnits.Atmosphere:
                return(InAtmospheres.ToString($"F{decimalPlaces}"));

            case PressureUnits.Bar:
                return(InBars.ToString($"F{decimalPlaces}"));

            case PressureUnits.Psi:
                return(InPsi.ToString($"F{decimalPlaces}"));
            }
            throw new ArgumentException("Unable to return value in" + units.ToString());
        }
Exemplo n.º 3
0
        public static string GetUnitSymbol(PressureUnits units)
        {
            switch (units)
            {
            case PressureUnits.Kpa:
                return(" KPa");

            case PressureUnits.Atmosphere:
                return(" ATM");

            case PressureUnits.Bar:
                return("Bar");

            case PressureUnits.Psi:
                return("Psi");
            }
            throw new ArgumentException("Unable to return symbol fir" + units.ToString());
        }