RoundingAlgorithm Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
None | 0 | Do not use. |
RoundAwayFromZero | 4 | Round away from zero. This is the equivalent of RoundUp if the input is positive, or RoundDown if the input is negative. |
RoundDown | 1 | Round towards negative infinity. (Return the largest integer, increment, or significant digit which does not exceed the input.) |
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. |
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. |
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. |
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. |
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. |
RoundTowardsZero | 3 | Round towards zero. This is the equivalent of RoundDown if the input is positive, or RoundUp if the input is negative. |
RoundUp | 2 | Round towards infinity. (Return the smallest integer, increment, or significant digit which is not less than the input.) |