System.Convert.ToDecimal(ushort)

Here are the examples of the csharp api System.Convert.ToDecimal(ushort) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

19 Source : UInt16AdvancedConverter.cs
with MIT License
from DataObjects-NET

decimal IAdvancedConverter<ushort, decimal>.Convert(ushort value)
    {
      return System.Convert.ToDecimal(value);
    }

19 Source : CharAdvancedConverter.cs
with MIT License
from DataObjects-NET

decimal IAdvancedConverter<char, decimal>.Convert(char value)
    {
      return System.Convert.ToDecimal(System.Convert.ToUInt16(value));
    }

19 Source : BasicConvert.Overload.cs
with MIT License
from Dogwei

decimal IXConverter<ushort, decimal>.Convert(ushort value)
			=> Convert.ToDecimal(value);

19 Source : UInt16Extensions.cs
with GNU General Public License v3.0
from ME3Tweaks

public static decimal ToDecimal(this ushort value)
		{
			return Convert.ToDecimal(value);
		}

19 Source : UShortConvertor.cs
with GNU General Public License v3.0
from SeeSharpOpenSource

protected override void InitializeConvertFuncs()
        {
            ConvertFuncs.Add(typeof(decimal).Name, sourceValue => System.Convert.ToDecimal((ushort)sourceValue));
            ConvertFuncs.Add(typeof(double).Name, sourceValue => System.Convert.ToDouble((ushort)sourceValue));
            ConvertFuncs.Add(typeof(float).Name, sourceValue => System.Convert.ToSingle((ushort)sourceValue));
            ConvertFuncs.Add(typeof(long).Name, sourceValue => System.Convert.ToInt64((ushort)sourceValue));
            ConvertFuncs.Add(typeof(ulong).Name, sourceValue => System.Convert.ToUInt64((ushort)sourceValue));
            ConvertFuncs.Add(typeof(int).Name, sourceValue => System.Convert.ToInt32((ushort)sourceValue));
            ConvertFuncs.Add(typeof(uint).Name, sourceValue => System.Convert.ToUInt32((ushort)sourceValue));
            ConvertFuncs.Add(typeof(short).Name, sourceValue => System.Convert.ToInt16((ushort)sourceValue));
//            ConvertFuncs.Add(typeof(ushort).Name, sourceValue => System.Convert.ToUInt16((ushort)sourceValue));
            ConvertFuncs.Add(typeof(char).Name, sourceValue => System.Convert.ToChar((ushort)sourceValue));
            ConvertFuncs.Add(typeof(byte).Name, sourceValue => System.Convert.ToByte((ushort)sourceValue));
            ConvertFuncs.Add(typeof(bool).Name, sourceValue => (ushort)sourceValue > 0);
            ConvertFuncs.Add(typeof(string).Name, sourceValue => sourceValue.ToString());
        }

19 Source : UInt16.cs
with MIT License
from Team-RTCLI

decimal IConvertible.ToDecimal(IFormatProvider? provider)
        {
            return Convert.ToDecimal(m_value);
        }