Table of Contents

Method RoundToInt

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

RoundToInt(double)

Rounds a double-precision floating-point number to the nearest integer, rounding away from zero for halfway cases.

public static int RoundToInt(double val)

Parameters

val double

The value to round.

Returns

int

The rounded integer value.

Examples

DoubleToInt(2.5)   // returns 3
DoubleToInt(-2.5)  // returns -3
DoubleToInt(1.4)   // returns 1
DoubleToInt(-1.4)  // returns -1
DoubleToInt(0.0)   // returns 0