Round()
Math::Round(double) method
Rounds the specified value to the nearest integral value.
static double System::Math::Round(double a)
Arguments
Parameter | Type | Description |
---|---|---|
a | double | The value to round |
Return Value
a rounded to the nearest integral value
Math::Round(double, int) method
Rounds the specified value to the nearest value with the specified number of fractional digits.
static double System::Math::Round(double value, int digits)
Arguments
Parameter | Type | Description |
---|---|---|
value | double | The value to round |
digits | int | The number of fractional digits in the rounded value |
Return Value
The number with the specified number of digits nearest to value
Math::Round(double, MidpointRounding) method
Rounds the specified value to the nearest integral number. A parameter specifies the function’s behavior if the specified value is equally close to two nearest numbers.
static double System::Math::Round(double value, MidpointRounding mode)
Arguments
Parameter | Type | Description |
---|---|---|
value | double | The value to round |
mode | MidpointRounding | Specifies how to perform the rounding if value is equally close to two nearest numbers. |
Return Value
value rounded to the nearest integral value
Math::Round(double, int, MidpointRounding) method
Rounds the specified value to the nearest value with the specified number of fractional digits. A parameter specifies the function’s behavior if the specified value is equally close to two nearest numbers.
static double System::Math::Round(double value, int digits, MidpointRounding mode)
Arguments
Parameter | Type | Description |
---|---|---|
value | double | The value to round |
digits | int | The number of fractional digits in the rounded value |
mode | MidpointRounding | Specifies how to perform the rounding if value is equally close to two nearest numbers. |
Return Value
The number with the specified number of digits nearest to value
Math::Round(const Decimal&) method
Rounds the specified value to the nearest integral value.
static Decimal System::Math::Round(const Decimal &d)
Arguments
Parameter | Type | Description |
---|---|---|
d | const Decimal& | The value to round |
Return Value
d rounded to the nearest integral value
Math::Round(const Decimal&, int) method
Rounds the specified value to the nearest value with the specified number of fractional digits.
static Decimal System::Math::Round(const Decimal &value, int digits)
Arguments
Parameter | Type | Description |
---|---|---|
value | const Decimal& | The value to round |
digits | int | The number of fractional digits in the rounded value |
Return Value
The number with the specified number of digits nearest to value
Math::Round(const Decimal&, MidpointRounding) method
Rounds the specified value to the nearest integral number. A parameter specifies the function’s behavior if the specified value is equally close to two nearest numbers.
static Decimal System::Math::Round(const Decimal &d, MidpointRounding mode)
Arguments
Parameter | Type | Description |
---|---|---|
d | const Decimal& | The value to round |
mode | MidpointRounding | Specifies how to perform the rounding if value is equally close to two nearest numbers. |
Return Value
d rounded to the nearest integral value
Math::Round(const Decimal&, int, MidpointRounding) method
Rounds the specified value to the nearest value with the specified number of fractional digits. A parameter specifies the function’s behavior if the specified value is equally close to two nearest numbers.
static Decimal System::Math::Round(const Decimal &d, int digits, MidpointRounding mode)
Arguments
Parameter | Type | Description |
---|---|---|
d | const Decimal& | The value to round |
digits | int | The number of fractional digits in the rounded value |
mode | MidpointRounding | Specifies how to perform the rounding if value is equally close to two nearest numbers. |
Return Value
The number with the specified number of digits nearest to value
See Also
- Enum MidpointRounding
- Class Decimal
- Struct Math
- Namespace System
- Library Aspose.Slides