Decimal.Clamp(Decimal, Decimal, Decimal) 方法

定義

將值限制為內含最小值和最大值。

public:
 static System::Decimal Clamp(System::Decimal value, System::Decimal min, System::Decimal max) = System::Numerics::INumber<System::Decimal>::Clamp;
public static decimal Clamp (decimal value, decimal min, decimal max);
static member Clamp : decimal * decimal * decimal -> decimal
Public Shared Function Clamp (value As Decimal, min As Decimal, max As Decimal) As Decimal

參數

value
Decimal

要限制的值。

min
Decimal

應固定的 value 內含最小值。

max
Decimal

應固定的 value 內含最大值。

傳回

限制 value 為 和 max 之內含範圍 min 的結果。

實作

適用於