Decimal.Implicit Operatör

Tanım

Türün değerinin bir değere örtük dönüştürmesini Decimal tanımlar.

Aşırı Yüklemeler

Name Description
Implicit(UInt16 to Decimal)

16 bit işaretsiz tamsayıya örtük bir Decimaldönüştürme tanımlar.

Bu API, CLS uyumlu değildir.

Implicit(UInt64 to Decimal)

64 bit işaretsiz tamsayıya örtük bir Decimaldönüştürme tanımlar.

Bu API, CLS uyumlu değildir.

Implicit(UInt32 to Decimal)

32 bit işaretsiz tamsayıya örtük bir Decimaldönüştürme tanımlar.

Bu API, CLS uyumlu değildir.

Implicit(SByte to Decimal)

8 bit imzalı bir tamsayıya örtük bir Decimaldönüştürme tanımlar.

Bu API, CLS uyumlu değildir.

Implicit(Int64 to Decimal)

64 bit imzalı bir tamsayıya örtük dönüştürmeyi Decimaltanımlar.

Implicit(Int32 to Decimal)

32 bit imzalı tamsayıya örtük bir Decimaldönüştürme tanımlar.

Implicit(Int16 to Decimal)

16 bit imzalı bir tamsayıya örtük bir Decimaldönüştürme tanımlar.

Implicit(Char to Decimal)

Unicode karakterinin öğesine örtük bir Decimaldönüştürmesini tanımlar.

Implicit(Byte to Decimal)

8 bit işaretsiz tamsayıya örtük bir Decimaldönüştürme tanımlar.

Açıklamalar

Implicit yönteminin aşırı yüklemeleri, derleyicinin bir Decimal değerini açık bir atama işleci (C#'ta) veya dönüştürme işlevine (Visual Basic) bir çağrı olmadan otomatik olarak dönüştürebileceği türleri tanımlar. Bunlar, veri kaybı içermeyen ve özel OverflowException durum oluşturmayan dönüştürmeleri genişletiyor.

Implicit(UInt16 to Decimal)

Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs

Önemli

Bu API, CLS uyumlu değildir.

16 bit işaretsiz tamsayıya örtük bir Decimaldönüştürme tanımlar.

Bu API, CLS uyumlu değildir.

public:
 static operator System::Decimal(System::UInt16 value);
[System.CLSCompliant(false)]
public static implicit operator decimal(ushort value);
[<System.CLSCompliant(false)>]
static member op_Implicit : uint16 -> decimal
Public Shared Widening Operator CType (value As UShort) As Decimal

Parametreler

value
UInt16

Dönüştürülecek 16 bit işaretsiz tamsayı.

Döndürülenler

Dönüştürülen 16 bit işaretsiz tamsayı.

Öznitelikler

Örnekler

Aşağıdaki örnek değerleri UInt16 sayılara Decimal dönüştürür.

using System;

class Example
{
    public static void Main()
    {
        // Define an array of 16-bit unsigned integer values.
        ushort[] values = { ushort.MinValue, ushort.MaxValue,
                            0xFFF, 12345, 40000 };
        // Convert each value to a Decimal.
        foreach (var value in values) {
           Decimal decValue = value;
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name);
        }
    }
}
// The example displays the following output:
//       0 (UInt16) --> 0 (Decimal)
//       65535 (UInt16) --> 65535 (Decimal)
//       4095 (UInt16) --> 4095 (Decimal)
//       12345 (UInt16) --> 12345 (Decimal)
//       40000 (UInt16) --> 40000 (Decimal)
open System

// Define a list of 16-bit unsigned integer values.
let values = 
    [ UInt16.MinValue; UInt16.MaxValue; 0xFFFus; 12345us; 40000us ]

// Convert each value to a Decimal.
for value in values do
    let decValue: decimal = value
    printfn $"{value} ({value.GetType().Name}) --> {decValue} ({decValue.GetType().Name})"

// The example displays the following output:
//       0 (UInt16) --> 0 (Decimal)
//       65535 (UInt16) --> 65535 (Decimal)
//       4095 (UInt16) --> 4095 (Decimal)
//       12345 (UInt16) --> 12345 (Decimal)
//       40000 (UInt16) --> 40000 (Decimal)
Module Example
    Public Sub Main()
        ' Define an array of 16-bit unsigned integer values.
        Dim values() As Decimal = { UShort.MinValue, UShort.MaxValue,     
                                    &hFFF, 12345, 40000 }
        ' Convert each value to a Decimal.
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)         
        Next
    End Sub 
End Module
' The example displays the following output:
'       0 (Decimal) --> 0 (Decimal)
'       65535 (Decimal) --> 65535 (Decimal)
'       4095 (Decimal) --> 4095 (Decimal)
'       12345 (Decimal) --> 12345 (Decimal)
'       40000 (Decimal) --> 40000 (Decimal)

Açıklamalar

Implicit yönteminin aşırı yüklemeleri, derleyicinin bir Decimal değerini açık bir atama işleci (C#'ta) veya dönüştürme işlevine (Visual Basic) bir çağrı olmadan otomatik olarak dönüştürebileceği türleri tanımlar. Bunlar, veri kaybı içermeyen ve özel OverflowException durum oluşturmayan dönüştürmeleri genişletiyor.

Ayrıca bkz.

Şunlara uygulanır

Implicit(UInt64 to Decimal)

Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs

Önemli

Bu API, CLS uyumlu değildir.

64 bit işaretsiz tamsayıya örtük bir Decimaldönüştürme tanımlar.

Bu API, CLS uyumlu değildir.

public:
 static operator System::Decimal(System::UInt64 value);
[System.CLSCompliant(false)]
public static implicit operator decimal(ulong value);
[<System.CLSCompliant(false)>]
static member op_Implicit : uint64 -> decimal
Public Shared Widening Operator CType (value As ULong) As Decimal

Parametreler

value
UInt64

Dönüştürülecek 64 bit işaretsiz tamsayı.

Döndürülenler

Dönüştürülen 64 bit işaretsiz tamsayı.

Öznitelikler

Örnekler

Aşağıdaki örnek, UInt64 dönüştürme işlecini Decimal kullanarak değerleri UInt64 sayılara Decimal dönüştürür.

using System;

public class Example
{
    public static void Main()
    {
        // Define an array of 64-bit unsigned integer values.
        ulong[] values = { ulong.MinValue, ulong.MaxValue,
                           0xFFFFFFFFFFFF, 123456789123456789,
                           1000000000000000 };
        // Convert each value to a Decimal.
        foreach (var value in values) {
           Decimal decValue = value;
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name);
        }
    }
}
// The example displays the following output:
//    0 (UInt64) --> 0 (Decimal)
//    18446744073709551615 (UInt64) --> 18446744073709551615 (Decimal)
//    281474976710655 (UInt64) --> 281474976710655 (Decimal)
//    123456789123456789 (UInt64) --> 123456789123456789 (Decimal)
//    1000000000000000 (UInt64) --> 1000000000000000 (Decimal)
open System

// Define a list of 64-bit unsigned integer values.
let values = 
    [ UInt64.MinValue; UInt64.MaxValue; 0xFFFFFFFFFFFFuL; 123456789123456789uL; 1000000000000000uL ]

// Convert each value to a Decimal.
for value in values do
    let decValue: decimal = value
    printfn $"{value} ({value.GetType().Name}) --> {decValue} ({decValue.GetType().Name})"

// The example displays the following output:
//    0 (UInt64) --> 0 (Decimal)
//    18446744073709551615 (UInt64) --> 18446744073709551615 (Decimal)
//    281474976710655 (UInt64) --> 281474976710655 (Decimal)
//    123456789123456789 (UInt64) --> 123456789123456789 (Decimal)
//    1000000000000000 (UInt64) --> 1000000000000000 (Decimal)
Module Example
    Public Sub Main()
        Dim values() As ULong = { ULong.MinValue, ULong.MaxValue, 
                           &hFFFFFFFFFFFF, 123456789123456789, 
                           1000000000000000 }
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)
        Next                              
    End Sub 
End Module
' The example displays the following output:
'    0 (UInt64) --> 0 (Decimal)
'    18446744073709551615 (UInt64) --> 18446744073709551615 (Decimal)
'    281474976710655 (UInt64) --> 281474976710655 (Decimal)
'    123456789123456789 (UInt64) --> 123456789123456789 (Decimal)
'    1000000000000000 (UInt64) --> 1000000000000000 (Decimal)

Açıklamalar

Implicit yönteminin aşırı yüklemeleri, derleyicinin bir Decimal değerini açık bir atama işleci (C#'ta) veya dönüştürme işlevine (Visual Basic) bir çağrı olmadan otomatik olarak dönüştürebileceği türleri tanımlar. Bunlar, veri kaybı içermeyen ve özel OverflowException durum oluşturmayan dönüştürmeleri genişletiyor.

Ayrıca bkz.

Şunlara uygulanır

Implicit(UInt32 to Decimal)

Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs

Önemli

Bu API, CLS uyumlu değildir.

32 bit işaretsiz tamsayıya örtük bir Decimaldönüştürme tanımlar.

Bu API, CLS uyumlu değildir.

public:
 static operator System::Decimal(System::UInt32 value);
[System.CLSCompliant(false)]
public static implicit operator decimal(uint value);
[<System.CLSCompliant(false)>]
static member op_Implicit : uint32 -> decimal
Public Shared Widening Operator CType (value As UInteger) As Decimal

Parametreler

value
UInt32

Dönüştürülecek 32 bit işaretsiz tamsayı.

Döndürülenler

Dönüştürülen 32 bit işaretsiz tamsayı.

Öznitelikler

Örnekler

Aşağıdaki örnek değerleri UInt32 sayılara Decimal dönüştürür.

using System;

class Example
{
    public static void Main()
    {
        // Define an array of 32-bit unsigned integer values.
        uint[] values = { uint.MinValue, uint.MaxValue, 0xFFFFFF,
                          123456789, 4000000000 };
        // Convert each value to a Decimal.
        foreach (var value in values) {
           Decimal decValue = value;
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name);
        }
    }
}
// The example displays the following output:
//       0 (UInt32) --> 0 (Decimal)
//       4294967295 (UInt32) --> 4294967295 (Decimal)
//       16777215 (UInt32) --> 16777215 (Decimal)
//       123456789 (UInt32) --> 123456789 (Decimal)
//       4000000000 (UInt32) --> 4000000000 (Decimal)
open System

// Define a list of 32-bit unsigned integer values.
let values = 
    [ UInt32.MinValue; UInt32.MaxValue; 0xFFFFFFu; 123456789u; 4000000000u ]

// Convert each value to a Decimal.
for value in values do
    let decValue: decimal = value
    printfn $"{value} ({value.GetType().Name}) --> {decValue} ({decValue.GetType().Name})"

// The example displays the following output:
//       0 (UInt32) --> 0 (Decimal)
//       4294967295 (UInt32) --> 4294967295 (Decimal)
//       16777215 (UInt32) --> 16777215 (Decimal)
//       123456789 (UInt32) --> 123456789 (Decimal)
//       4000000000 (UInt32) --> 4000000000 (Decimal)
Module Example
    Public Sub Main()
        ' Define an array of 32-bit unsigned integer values.
        Dim values() As UInteger = { UInteger.MinValue, UInteger.MaxValue, 
                                     &hFFFFFF, 123456789, 4000000000 }
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)           
        Next   
    End Sub 
End Module
' The example displays the following output:
'       0 (UInt32) --> 0 (Decimal)
'       4294967295 (UInt32) --> 4294967295 (Decimal)
'       16777215 (UInt32) --> 16777215 (Decimal)
'       123456789 (UInt32) --> 123456789 (Decimal)
'       4000000000 (UInt32) --> 4000000000 (Decimal)

Açıklamalar

Implicit yönteminin aşırı yüklemeleri, derleyicinin bir Decimal değerini açık bir atama işleci (C#'ta) veya dönüştürme işlevine (Visual Basic) bir çağrı olmadan otomatik olarak dönüştürebileceği türleri tanımlar. Bunlar, veri kaybı içermeyen ve özel OverflowException durum oluşturmayan dönüştürmeleri genişletiyor.

Ayrıca bkz.

Şunlara uygulanır

Implicit(SByte to Decimal)

Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs

Önemli

Bu API, CLS uyumlu değildir.

8 bit imzalı bir tamsayıya örtük bir Decimaldönüştürme tanımlar.

Bu API, CLS uyumlu değildir.

public:
 static operator System::Decimal(System::SByte value);
[System.CLSCompliant(false)]
public static implicit operator decimal(sbyte value);
[<System.CLSCompliant(false)>]
static member op_Implicit : sbyte -> decimal
Public Shared Widening Operator CType (value As SByte) As Decimal

Parametreler

value
SByte

Dönüştürülecek 8 bit işaretli tamsayı.

Döndürülenler

Dönüştürülen 8 bit imzalı tamsayı.

Öznitelikler

Örnekler

Aşağıdaki örnek değerleri SByte sayılara Decimal dönüştürür.

using System;

class Example
{
    public static void Main()
    {
        // Define an array of 8-bit signed integer values.
        sbyte[] values = { sbyte.MinValue, sbyte.MaxValue,
                           0x3F, 123, -100 };
        // Convert each value to a Decimal.
        foreach (var value in values) {
           Decimal decValue = value;
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name);
        }
    }
}
// The example displays the following output:
//    -128 (SByte) --> -128 (Decimal)
//    127 (SByte) --> 127 (Decimal)
//    63 (SByte) --> 63 (Decimal)
//    123 (SByte) --> 123 (Decimal)
//    -100 (SByte) --> -100 (Decimal)
open System

// Define a list of 8-bit signed integer values.
let values = 
    [ SByte.MinValue; SByte.MaxValue; 0x3Fy; 123y; -100y ]

// Convert each value to a Decimal.
for value in values do
    let decValue: decimal = value
    printfn $"{value} ({value.GetType().Name}) --> {decValue} ({decValue.GetType().Name})"

// The example displays the following output:
//    -128 (SByte) --> -128 (Decimal)
//    127 (SByte) --> 127 (Decimal)
//    63 (SByte) --> 63 (Decimal)
//    123 (SByte) --> 123 (Decimal)
//    -100 (SByte) --> -100 (Decimal)
Module Example
    Public Sub Main()
        ' Define an array of 8-bit signed integer values.
        Dim values() As SByte = { SByte.MinValue, SByte.MaxValue,     
                                  &h3F, 123, -100 }
        ' Convert each value to a Decimal.
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)
        Next                         
    End Sub
End Module
' The example displays the following output:
'       -128 (SByte) --> -128 (Decimal)
'       127 (SByte) --> 127 (Decimal)
'       63 (SByte) --> 63 (Decimal)
'       123 (SByte) --> 123 (Decimal)
'       -100 (SByte) --> -100 (Decimal)

Açıklamalar

Implicit yönteminin aşırı yüklemeleri, derleyicinin bir Decimal değerini açık bir atama işleci (C#'ta) veya dönüştürme işlevine (Visual Basic) bir çağrı olmadan otomatik olarak dönüştürebileceği türleri tanımlar. Bunlar, veri kaybı içermeyen ve özel OverflowException durum oluşturmayan dönüştürmeleri genişletiyor.

Ayrıca bkz.

Şunlara uygulanır

Implicit(Int64 to Decimal)

Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs

64 bit imzalı bir tamsayıya örtük dönüştürmeyi Decimaltanımlar.

public:
 static operator System::Decimal(long value);
public static implicit operator decimal(long value);
static member op_Implicit : int64 -> decimal
Public Shared Widening Operator CType (value As Long) As Decimal

Parametreler

value
Int64

Dönüştürülecek 64 bit imzalı tamsayı.

Döndürülenler

Dönüştürülen 64 bit imzalı tamsayı.

Örnekler

Aşağıdaki örnek değerleri Int64 sayılara Decimal dönüştürür.

using System;

class Example
{
    public static void Main()
    {
        // Define an array of 64-bit integer values.
        long[] values = { long.MinValue, long.MaxValue,
                          0xFFFFFFFFFFFF, 123456789123456789,
                          -1000000000000000 };
        // Convert each value to a Decimal.
        foreach (var value in values) {
           Decimal decValue = value;
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name);
        }
    }
}
// The example displays the following output:
//    -9223372036854775808 (Int64) --> -9223372036854775808 (Decimal)
//    9223372036854775807 (Int64) --> 9223372036854775807 (Decimal)
//    281474976710655 (Int64) --> 281474976710655 (Decimal)
//    123456789123456789 (Int64) --> 123456789123456789 (Decimal)
//    -1000000000000000 (Int64) --> -1000000000000000 (Decimal)
open System

// Define a list of 64-bit integer values.
let values = 
    [ Int64.MinValue; Int64.MaxValue; 0xFFFFFFFFFFFFL; 123456789123456789L; -1000000000000000L ]

// Convert each value to a Decimal.
for value in values do
    let decValue: decimal = value
    printfn $"{value} ({value.GetType().Name}) --> {decValue} ({decValue.GetType().Name})"

// The example displays the following output:
//    -9223372036854775808 (Int64) --> -9223372036854775808 (Decimal)
//    9223372036854775807 (Int64) --> 9223372036854775807 (Decimal)
//    281474976710655 (Int64) --> 281474976710655 (Decimal)
//    123456789123456789 (Int64) --> 123456789123456789 (Decimal)
//    -1000000000000000 (Int64) --> -1000000000000000 (Decimal)
Module Example
    Public Sub Main()
        ' Define an array of 64-bit integer values.
        Dim values() As Long = { Long.MinValue, Long.MaxValue, 
                                 &hFFFFFFFFFFFF, 123456789123456789,
                                 -1000000000000000 }
        ' Convert each value to a Decimal.
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)
        Next
    End Sub 
End Module
' The example displays the following output:
'    -9223372036854775808 (Int64) --> -9223372036854775808 (Decimal)
'    9223372036854775807 (Int64) --> 9223372036854775807 (Decimal)
'    281474976710655 (Int64) --> 281474976710655 (Decimal)
'    123456789123456789 (Int64) --> 123456789123456789 (Decimal)
'    -1000000000000000 (Int64) --> -1000000000000000 (Decimal)

Açıklamalar

Implicit yönteminin aşırı yüklemeleri, derleyicinin bir Decimal değerini açık bir atama işleci (C#'ta) veya dönüştürme işlevine (Visual Basic) bir çağrı olmadan otomatik olarak dönüştürebileceği türleri tanımlar. Bunlar, veri kaybı içermeyen ve özel OverflowException durum oluşturmayan dönüştürmeleri genişletiyor.

Ayrıca bkz.

Şunlara uygulanır

Implicit(Int32 to Decimal)

Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs

32 bit imzalı tamsayıya örtük bir Decimaldönüştürme tanımlar.

public:
 static operator System::Decimal(int value);
public static implicit operator decimal(int value);
static member op_Implicit : int -> decimal
Public Shared Widening Operator CType (value As Integer) As Decimal

Parametreler

value
Int32

Dönüştürülecek 32 bit imzalı tamsayı.

Döndürülenler

Dönüştürülen 32 bit imzalı tamsayı.

Örnekler

Aşağıdaki örnek değerleri Int32 sayılara Decimal dönüştürür.

using System;

class Example
{
    public static void Main()
    {
        // Define an array of 32-bit integer values.
        int[] values = { int.MinValue, int.MaxValue, 0xFFFFFF,
                         123456789, -1000000000 };
        // Convert each value to a Decimal.
        foreach (var value in values) {
           Decimal decValue = value;
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name);
        }
    }
}
// The example displays the following output:
//    -2147483648 (Int32) --> -2147483648 (Decimal)
//    2147483647 (Int32) --> 2147483647 (Decimal)
//    16777215 (Int32) --> 16777215 (Decimal)
//    123456789 (Int32) --> 123456789 (Decimal)
//    -1000000000 (Int32) --> -1000000000 (Decimal)
open System

// Define a list of 32-bit integer values.
let values = 
    [ Int32.MinValue; Int32.MaxValue; 0xFFFFFF; 123456789; -1000000000 ]

// Convert each value to a Decimal.
for value in values do
    let decValue: decimal = value
    printfn $"{value} ({value.GetType().Name}) --> {decValue} ({decValue.GetType().Name})"

// The example displays the following output:
//    -2147483648 (Int32) --> -2147483648 (Decimal)
//    2147483647 (Int32) --> 2147483647 (Decimal)
//    16777215 (Int32) --> 16777215 (Decimal)
//    123456789 (Int32) --> 123456789 (Decimal)
//    -1000000000 (Int32) --> -1000000000 (Decimal)
Module Example
    Public Sub Main()
       ' Define an array of 32-bit integer values.
       Dim values() As Integer = { Integer.MinValue, Integer.MaxValue, 
                                   &hFFFFFF, 123456789, -1000000000 }
       ' Convert each value to a Decimal.
       For Each value In values
          Dim decValue As Decimal = value 
          Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                            value.GetType().Name, decValue,
                            decValue.GetType().Name)
       Next                     
    End Sub 
End Module
' The example displays the following output:
'       -2147483648 (Int32) --> -2147483648 (Decimal)
'       2147483647 (Int32) --> 2147483647 (Decimal)
'       16777215 (Int32) --> 16777215 (Decimal)
'       123456789 (Int32) --> 123456789 (Decimal)
'       -1000000000 (Int32) --> -1000000000 (Decimal)

Açıklamalar

Implicit yönteminin aşırı yüklemeleri, derleyicinin bir Decimal değerini açık bir atama işleci (C#'ta) veya dönüştürme işlevine (Visual Basic) bir çağrı olmadan otomatik olarak dönüştürebileceği türleri tanımlar. Bunlar, veri kaybı içermeyen ve özel OverflowException durum oluşturmayan dönüştürmeleri genişletiyor.

Ayrıca bkz.

Şunlara uygulanır

Implicit(Int16 to Decimal)

Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs

16 bit imzalı bir tamsayıya örtük bir Decimaldönüştürme tanımlar.

public:
 static operator System::Decimal(short value);
public static implicit operator decimal(short value);
static member op_Implicit : int16 -> decimal
Public Shared Widening Operator CType (value As Short) As Decimal

Parametreler

value
Int16

Dönüştürülecek 16 bit imzalı tamsayı.

Döndürülenler

Dönüştürülen 16 bit imzalı tamsayı.

Örnekler

Aşağıdaki örnek değerleri Int16 sayılara Decimal dönüştürür. Bu dönüştürme için Visual Basic op_Implicit işleci gerekir, ancak C# içinde gerekmez.

using System;

class Example
{
    public static void Main()
    {
        // Define an array of 16-bit integer values.
        short[] values = { short.MinValue, short.MaxValue,
                           0xFFF, 12345, -10000 };
        // Convert each value to a Decimal.
        foreach (var value in values) {
           Decimal decValue = value;
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name);
        }
    }
}
// The example displays the following output:
//       -32768 (Int16) --> -32768 (Decimal)
//       32767 (Int16) --> 32767 (Decimal)
//       4095 (Int16) --> 4095 (Decimal)
//       12345 (Int16) --> 12345 (Decimal)
//       -10000 (Int16) --> -10000 (Decimal)
open System

// Define a list of 16-bit integer values.
let values = 
    [ Int16.MinValue; Int16.MaxValue; 0xFFFs; 12345s; -10000s ]

// Convert each value to a Decimal.
for value in values do
    let decValue: decimal = value
    printfn $"{value} ({value.GetType().Name}) --> {decValue} ({decValue.GetType().Name})"

// The example displays the following output:
//       -32768 (Int16) --> -32768 (Decimal)
//       32767 (Int16) --> 32767 (Decimal)
//       4095 (Int16) --> 4095 (Decimal)
//       12345 (Int16) --> 12345 (Decimal)
//       -10000 (Int16) --> -10000 (Decimal)
Module Example
    Public Sub Main()
        ' Define an array of 16-bit integer values.
        Dim values() As Short = { Short.MinValue, Short.MaxValue, 
                                  &hFFF, 12345, -10000 }   
        ' Convert each value to a Decimal.
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)         
        Next
    End Sub 
End Module
' The example displays the following output:
'    -32768 (Int16) --> -32768 (Decimal)
'    32767 (Int16) --> 32767 (Decimal)
'    4095 (Int16) --> 4095 (Decimal)
'    12345 (Int16) --> 12345 (Decimal)
'    -10000 (Int16) --> -10000 (Decimal)

Açıklamalar

Implicit yönteminin aşırı yüklemeleri, derleyicinin bir Decimal değerini açık bir atama işleci (C#'ta) veya dönüştürme işlevine (Visual Basic) bir çağrı olmadan otomatik olarak dönüştürebileceği türleri tanımlar. Bunlar, veri kaybı içermeyen ve özel OverflowException durum oluşturmayan dönüştürmeleri genişletiyor.

Ayrıca bkz.

Şunlara uygulanır

Implicit(Char to Decimal)

Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs

Unicode karakterinin öğesine örtük bir Decimaldönüştürmesini tanımlar.

public:
 static operator System::Decimal(char value);
public static implicit operator decimal(char value);
static member op_Implicit : char -> decimal
Public Shared Widening Operator CType (value As Char) As Decimal

Parametreler

value
Char

Dönüştürülecek Unicode karakteri.

Döndürülenler

Dönüştürülen Unicode karakteri.

Örnekler

Aşağıdaki örnek değerleri Char (Unicode karakterleri) sayılara Decimal dönüştürür. Bu dönüştürme için Visual Basic op_Implicit işleci gerekir, ancak C# içinde gerekmez.

using System;

class Example
{
    public static void Main()
    {
        // Define an array of Char values.
        Char[] values = { '\0', ' ', '*', 'A', 'a', '{', 'Æ' };

        // Convert each Char value to a Decimal.
        foreach (var value in values) {
           decimal decValue = value;
           Console.WriteLine("'{0}' ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name);
        }
    }
}
// The example displays the following output:
//       ' ' (Char) --> 0 (Decimal)
//       ' ' (Char) --> 32 (Decimal)
//       '*' (Char) --> 42 (Decimal)
//       'A' (Char) --> 65 (Decimal)
//       'a' (Char) --> 97 (Decimal)
//       '{' (Char) --> 123 (Decimal)
//       'Æ' (Char) --> 198 (Decimal)
// Define a list of Char values.
let values = [ '\000'; ' '; '*'; 'A'; 'a'; '{'; 'Æ' ]

// Convert each Char value to a Decimal.
for value in values do
    let decValue: decimal = value
    printfn $"'{value}' ({value.GetType().Name}) --> {decValue} ({decValue.GetType().Name})"

// The example displays the following output:
//       ' ' (Char) --> 0 (Decimal)
//       ' ' (Char) --> 32 (Decimal)
//       '*' (Char) --> 42 (Decimal)
//       'A' (Char) --> 65 (Decimal)
//       'a' (Char) --> 97 (Decimal)
//       '{' (Char) --> 123 (Decimal)
//       'Æ' (Char) --> 198 (Decimal)
Module Example
    Public Sub Main()
        ' Define an array of Char values.
        Dim values() As Char = { ChrW(0), " "c, "*"c, "A"c, "a"c, 
                                 "{"c, "Æ"c }

        ' Convert each Char value to a Decimal.
        For Each value In values
           Dim decValue As Decimal = Decimal.op_Implicit(value)
           Console.WriteLine("'{0}' ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)      
        Next
    End Sub 
End Module
' The example displays the following output:
'       ' ' (Char) --> 0 (Decimal)
'       ' ' (Char) --> 32 (Decimal)
'       '*' (Char) --> 42 (Decimal)
'       'A' (Char) --> 65 (Decimal)
'       'a' (Char) --> 97 (Decimal)
'       '{' (Char) --> 123 (Decimal)
'       'Æ' (Char) --> 198 (Decimal)

Açıklamalar

Implicit yönteminin aşırı yüklemeleri, derleyicinin bir Decimal değerini açık bir atama işleci (C#'ta) veya dönüştürme işlevine (Visual Basic) bir çağrı olmadan otomatik olarak dönüştürebileceği türleri tanımlar. Bunlar, veri kaybı içermeyen ve özel OverflowException durum oluşturmayan dönüştürmeleri genişletiyor.

Ayrıca bkz.

Şunlara uygulanır

Implicit(Byte to Decimal)

Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs
Kaynak:
Decimal.cs

8 bit işaretsiz tamsayıya örtük bir Decimaldönüştürme tanımlar.

public:
 static operator System::Decimal(System::Byte value);
public static implicit operator decimal(byte value);
static member op_Implicit : byte -> decimal
Public Shared Widening Operator CType (value As Byte) As Decimal

Parametreler

value
Byte

Dönüştürülecek 8 bit işaretsiz tamsayı.

Döndürülenler

Dönüştürülen 8 bit işaretsiz tamsayı.

Örnekler

Aşağıdaki örnek değerleri Byte sayılara Decimal dönüştürür.

using System;

class Example
{
    public static void Main()
    {
        // Define an array of byte values.
        byte[] values = { byte.MinValue, byte.MaxValue,
                          0x3F, 123, 200 };
        // Convert each value to a Decimal.
        foreach (var value in values) {
           decimal decValue = value;
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name);
        }
    }
}
// The example displays the following output:
//       0 (Byte) --> 0 (Decimal)
//       255 (Byte) --> 255 (Decimal)
//       63 (Byte) --> 63 (Decimal)
//       123 (Byte) --> 123 (Decimal)
//       200 (Byte) --> 200 (Decimal)
open System

// Define a list of byte values.
let values = 
    [ Byte.MinValue; Byte.MaxValue; 0x3Fuy; 123uy; 200uy ]

// Convert each value to a Decimal.
for value in values do
    let decValue: decimal = value
    printfn $"{value} ({value.GetType().Name}) --> {decValue} ({decValue.GetType().Name})"

// The example displays the following output:
//       0 (Byte) --> 0 (Decimal)
//       255 (Byte) --> 255 (Decimal)
//       63 (Byte) --> 63 (Decimal)
//       123 (Byte) --> 123 (Decimal)
//       200 (Byte) --> 200 (Decimal)
Module Example
    Public Sub Main
        ' Define an array of byte values.
        Dim values() As Byte = { Byte.MinValue, Byte.MaxValue, 
                                 &h3F, 123, 200 }   
        ' Convert each value to a Decimal.
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)                   
        Next   
    End Sub 
End Module
' The example displays the following output:
'       0 (Byte) --> 0 (Decimal)
'       255 (Byte) --> 255 (Decimal)
'       63 (Byte) --> 63 (Decimal)
'       123 (Byte) --> 123 (Decimal)
'       200 (Byte) --> 200 (Decimal)

Açıklamalar

Implicit yönteminin aşırı yüklemeleri, derleyicinin bir Decimal değerini açık bir atama işleci (C#'ta) veya dönüştürme işlevine (Visual Basic) bir çağrı olmadan otomatik olarak dönüştürebileceği türleri tanımlar. Bunlar, veri kaybı içermeyen ve özel OverflowException durum oluşturmayan dönüştürmeleri genişletiyor.

Ayrıca bkz.

Şunlara uygulanır