DefaultRoundingStrategy Class

Implements the default strategy for rounding numbers.

Definition

Namespace: InnerDrive.Financial
Assembly: InnerDrive.Financial (in InnerDrive.Financial.dll) Version: 5.2.9017.0
C#
[SerializableAttribute]
public class DefaultRoundingStrategy : IRoundingStrategy
Inheritance
Object    DefaultRoundingStrategy
Implements
IRoundingStrategy

Remarks

The behavior of the Round method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding to nearest, or banker's rounding. If decimals is zero, this kind of rounding is sometimes called rounding toward zero.
ValueRounded to
0.4900
0.4940
0.4950
0.4990
0.5000
0.5011
0.9901
0.9941
0.9951
0.9991

Constructors

DefaultRoundingStrategyInitializes a new instance of the DefaultRoundingStrategy class

Properties

MaxDigits Returns the maximum number of significant digits to which the Round(Decimal, Int32) method can round.
Name Returns the friendly name of the rounding strategy.
TypeName Gets the FullName to assist serialization

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Round Returns a decimal rounded to the nearest value of 10^-n.
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also