Table of Contents

MidpointRoundingStrategy Class

Definition

Namespace
Bodu.Financial
Assembly
Bodu.Financial.dll
Package
Bodu.Financial 1.0.0
Source
MidpointRoundingStrategy.cs
public sealed class MidpointRoundingStrategy : IRoundingStrategy
Inheritance
MidpointRoundingStrategy
Implements
Inherited Members
Extension Methods

Constructors

MidpointRoundingStrategy(MidpointRounding)

Initializes a new instance of the MidpointRoundingStrategy class.

public MidpointRoundingStrategy(MidpointRounding mode)

Parameters

mode MidpointRounding

The midpoint-rounding mode to apply.

Fields

AwayFromZero

The shared away-from-zero (AwayFromZero) strategy.

public static readonly MidpointRoundingStrategy AwayFromZero

Field Value

MidpointRoundingStrategy

ToEven

The shared banker's-rounding (ToEven) strategy.

public static readonly MidpointRoundingStrategy ToEven

Field Value

MidpointRoundingStrategy

Properties

Mode

Gets the midpoint-rounding mode applied by this strategy.

public MidpointRounding Mode { get; }

Property Value

MidpointRounding

The configured MidpointRounding mode.

Methods

Round(decimal, int)

Rounds value to scale fractional digits.

public decimal Round(decimal value, int scale)

Parameters

value decimal

The raw amount to round.

scale int

The number of fractional digits to round to.

Returns

decimal

The rounded amount.

Applies to

ProductVersions
.NET8, 10