Example #1
0
        public override int GetHashCode()
        {
            var hashCode = 1337393187;

            hashCode = hashCode * (-1521134295 + InLiters.GetHashCode());
            hashCode = hashCode * (-1521134295 + InLiters.GetHashCode());
            hashCode = hashCode * (-1521134295 + InUsGallons.GetHashCode());
            return(hashCode);
        }
Example #2
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());
        }