Share via


RoundingAlgorithm Enum

Definition

Specifies the algorithm used to round numbers.

public enum class RoundingAlgorithm
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
enum class RoundingAlgorithm
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum RoundingAlgorithm
var value = Windows.Globalization.NumberFormatting.RoundingAlgorithm.none
Public Enum RoundingAlgorithm
Inheritance
RoundingAlgorithm
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Fields

Name Value Description
None 0

Do not use.

RoundDown 1

Round towards negative infinity. (Return the largest integer, increment, or significant digit which does not exceed the input.)

RoundUp 2

Round towards infinity. (Return the smallest integer, increment, or significant digit which is not less than the input.)

RoundTowardsZero 3

Round towards zero. This is the equivalent of RoundDown if the input is positive, or RoundUp if the input is negative.

RoundAwayFromZero 4

Round away from zero. This is the equivalent of RoundUp if the input is positive, or RoundDown if the input is negative.

RoundHalfDown 5

Round to the integer, increment, or significant digit that is closest to the input. If the input is exactly halfway between the possible outputs, this is the equivalent of RoundDown.

RoundHalfUp 6

Round to the integer, increment, or significant digit that is closest to the input. If the input is exactly halfway between the possible outputs, this is the equivalent of RoundUp.

RoundHalfTowardsZero 7

Round to the integer, increment, or significant digit that is closest to the input. If the input is exactly halfway between the possible outputs, this is the equivalent of RoundTowardsZero.

RoundHalfAwayFromZero 8

Round to the integer, increment, or significant digit that is closest to the input. If the input is exactly halfway between the possible outputs, this is the equivalent of RoundAwayFromZero.

RoundHalfToEven 9

Round to the integer, increment, or significant digit that is closest to the input. If the input is exactly halfway between the possible outputs, round to the nearest even output.

RoundHalfToOdd 10

Round to the integer, increment, or significant digit that is closest to the input. If the input is exactly halfway between the possible outputs, round to the nearest odd output.

Applies to

See also