# RoundingMode

Select the rounding direction for integer tweens. The default ToEven rounds midpoint ties to an even integer.

Namespace: MeatMotion

Assembly: MeatMotion

```csharp
public enum RoundingMode : byte
```

[Runtime/Adapters/BuiltIn/IntegerOptions.cs · L5](../../../source/Runtime/Adapters/BuiltIn/IntegerOptions.cs.html#L5)

## Truncate an integer counter

Add `using MeatMotion;`. Halfway from 0 to 5 the interpolated value is 2.5. ToZero writes 2 to the counter.

```csharp
int counter = 0;
using var world = new MotionWorld();
MMotion.Create(0, 5, 1f).WithRoundingMode(RoundingMode.ToZero)
    .WithScheduler(world).Bind(v => counter = v);
world.Tick(0.5);
```

## ToEven

Round to the nearest integer and choose even at a midpoint.

```csharp
ToEven
```

[Runtime/Adapters/BuiltIn/IntegerOptions.cs · L5](../../../source/Runtime/Adapters/BuiltIn/IntegerOptions.cs.html#L5)

## AwayFromZero

Round fractional values away from zero, upward for positive values and downward for negative ones.

```csharp
AwayFromZero
```

[Runtime/Adapters/BuiltIn/IntegerOptions.cs · L5](../../../source/Runtime/Adapters/BuiltIn/IntegerOptions.cs.html#L5)

## ToZero

Discard the fractional part toward zero.

```csharp
ToZero
```

[Runtime/Adapters/BuiltIn/IntegerOptions.cs · L5](../../../source/Runtime/Adapters/BuiltIn/IntegerOptions.cs.html#L5)

## ToPositiveInfinity

Round upward toward positive infinity.

```csharp
ToPositiveInfinity
```

[Runtime/Adapters/BuiltIn/IntegerOptions.cs · L5](../../../source/Runtime/Adapters/BuiltIn/IntegerOptions.cs.html#L5)

## ToNegativeInfinity

Round downward toward negative infinity.

```csharp
ToNegativeInfinity
```

[Runtime/Adapters/BuiltIn/IntegerOptions.cs · L5](../../../source/Runtime/Adapters/BuiltIn/IntegerOptions.cs.html#L5)
