示例#1
0
        public void ConvertFromReturnsCorrectConversion()
        {
            var prefix = new Prefix(1000m);

            Assert.AreEqual(1500, prefix.ConvertFrom(1.5m));

            prefix = new Prefix(0.001m);
            Assert.AreEqual(1.5m, prefix.ConvertFrom(1500));
        }
示例#2
0
 /// <summary>
 /// Converts a value from prefixed representation to non-prefixed representation.
 /// </summary>
 /// <param name="value">The value to convert to non-prefixed representation.</param>
 /// <param name="prefix">The prefix to remove from the value.</param>
 /// <returns>The non-prefixed representation.</returns>
 public static decimal ConvertFrom(Prefix prefix, decimal value)
 {
     return(prefix.ConvertFrom(value));
 }