コード例 #1
0
        public string ToString(string format, IFormatProvider formatProvider)
        {
            ContractsCommon.ResultIsNonNull <string>();

            if (format == null)
            {
                format = _defaultFormat;
            }
            if (format.StartsWith("N", StringComparison.InvariantCultureIgnoreCase))
            {
                return(NanoCoins.ToString(format.Substring(1), formatProvider));
            }

            return(WholeCoins.ToString(format, formatProvider));
        }
コード例 #2
0
        public bool Equals(BitcoinValue other)
        {
            Contract.Ensures(Contract.Result <bool>() == false || this.GetHashCode() == other.GetHashCode());

            return(NanoCoins.Equals(other.NanoCoins));
        }
コード例 #3
0
 public override int GetHashCode()
 {
     return(NanoCoins.GetHashCode());
 }
コード例 #4
0
        public int CompareTo(BitcoinValue other)
        {
            Contract.Ensures(-1 <= Contract.Result <int>() && Contract.Result <int>() <= 1);

            return(NanoCoins.CompareTo(other));
        }