Decimal.Increment(Decimal) Operatör
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
İşleneni Decimal 1 artırır.
public:
static System::Decimal operator ++(System::Decimal d);
public:
static System::Decimal operator ++(System::Decimal d) = System::Numerics::IIncrementOperators<System::Decimal>::op_Increment;
public static decimal operator ++(decimal d);
static member op_Increment : decimal -> decimal
Public Shared op_Increment (d As Decimal) As Decimal
- d
- Decimal
Artıracak değer.
d
Değeri 1 artırıldı.
Dönüş değeri Decimal.MinValue değerinden küçük veya Decimal.MaxValue değerinden büyük.
yöntemi, Increment değerler için Decimal increment işlecinin işlemini tanımlar. Bu, aşağıdaki gibi bir kod sağlar:
using System;
public class Example
{
public static void Main()
{
Decimal number = 1079.8m;
Console.WriteLine("Original value: {0:N}", number);
Console.WriteLine("Incremented value: {0:N}", ++number);
}
}
// The example displays the following output:
// Original value: 1,079.80
// Incremented value: 1,080.80
open System
let number = 1079.8m
printfn $"Original value: {number:N}"
printfn $"Incremented value: {Decimal.op_Increment number:N}"
// The example displays the following output:
// Original value: 1,079.80
// Incremented value: 1,080.80
Artırma işleci olmayan bazı diller (Visual Basic gibi) aşağıdaki örnekte gösterildiği gibi yöntemini doğrudan çağırabilir Increment .
Module Example
Public Sub Main()
Dim number As Decimal = 1079.8d
Console.WriteLine("Original value: {0:N}", number)
Console.WriteLine("Incremented value: {0:N}", Decimal.op_Increment(number))
End Sub
End Module
' The example displays the following output:
' Original value: 1,079.80
' Incremented value: 1,080.80
Diliniz özel işleçleri desteklemiyorsa, aşağıdaki örnekte gösterildiği gibi bunun yerine yöntemini çağırın Add .
using System;
public class Example
{
public static void Main()
{
Decimal number = 1079.8m;
Console.WriteLine("Original value: {0:N}", number);
Console.WriteLine("Incremented value: {0:N}", Decimal.Add(number, 1));
}
}
// The example displays the following output:
// Original value: 1,079.80
// Incremented value: 1,080.80
open System
let number = 1079.8m
printfn $"Original value: {number:N}"
printfn $"Incremented value: {Decimal.Add(number, 1):N}"
// The example displays the following output:
// Original value: 1,079.80
// Incremented value: 1,080.80
Module Example
Public Sub Main()
Dim number As Decimal = 1079.8d
Console.WriteLine("Original value: {0:N}", number)
Console.WriteLine("Incremented value: {0:N}", Decimal.Add(number, 1))
End Sub
End Module
' The example displays the following output:
' Original value: 1,079.80
' Incremented value: 1,080.80
Ürün | Sürümler |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET geri bildirimi
.NET, açık kaynak bir projedir. Geri bildirim sağlamak için bir bağlantı seçin: