System.MethodExtension.WeiToEther C# (CSharp) Метод

WeiToEther() публичный статический Метод

public static WeiToEther ( this value ) : string
value this
Результат string
        public static string WeiToEther(this BigInteger value)
        {
            var divRem1 = BigInteger.Zero;
            var bal = BigInteger.DivRem(value, 1000000000000000000, out divRem1);
            var balanceString = string.Format("{0}.{1}", bal, divRem1);
            var decimalBalance = decimal.Parse(balanceString);
            return decimalBalance.ToString("0.00");
        }