Akka.Cluster.MetricNumericConverter.ConvertNumber C# (CSharp) Method

ConvertNumber() public static method

Here in .NET-istan, we're going to use double for all metrics since we don't have convenient base classes for denoting general numeric types like Scala. If a specific metrics method needs an integral data type, it should convert down from double.
public static ConvertNumber ( object from ) : double
from object
return double
        public static double ConvertNumber(object from)
        {
            if (from is double) return (double)from;
            if (from is float) return Convert.ToDouble((float)from);
            if (from is int) return Convert.ToDouble((int)from);
            if (from is uint) return Convert.ToDouble((uint)from);
            if (from is long) return Convert.ToDouble((long)from);
            if (from is ulong) return Convert.ToDouble((ulong)from);
            throw new ArgumentException(string.Format("Not a number [{0}]", from), "from");
        }
    }
MetricNumericConverter