示例#1
0
        public string GetValueInUnits(VolumeUnits units, int decimalPlaces)
        {
            switch (units)
            {
            case VolumeUnits.Liters:
                return(InLiters.ToString($"F{decimalPlaces}"));

            case VolumeUnits.UsGallons:
                return(InUsGallons.ToString($"F{decimalPlaces}"));
            }
            throw new ArgumentException("Unable to return value in" + units.ToString());
        }