System::Decimal::Round メソッド

Decimal::Round(const Decimal&, int, MidpointRounding) method

指定された小数桁数で、指定された値を最も近い値に丸めます。パラメーターは、指定された値が 2 つの最も近い数と同等に近い場合の関数の動作を指定します。

static Decimal System::Decimal::Round(const Decimal &d, int digits, MidpointRounding mode=MidpointRounding::ToEven)
パラメーター説明
dconst Decimal&丸める値
桁数int丸められた値の小数桁数
modeMidpointRoundingvalue が2つの最も近い数値と同等に近い場合の丸め方法を指定します。

ReturnValue

指定された桁数で value に最も近い数

参照

Decimal::Round(const Decimal&, MidpointRounding) method

指定された値を最も近い整数に丸めます。パラメーターは、指定された値が 2 つの最も近い数と同等に近い場合の関数の動作を指定します。

static Decimal System::Decimal::Round(const Decimal &d, MidpointRounding mode=MidpointRounding::ToEven)
パラメーター説明
dconst Decimal&丸める値
modeMidpointRoundingvalue が2つの最も近い数値と同等に近い場合の丸め方法を指定します。

ReturnValue

d rounded to the nearest integral value

参照