MathExtensions Round Method (Single)Delta Engine Documentation

Namespace: DeltaEngine.Extensions
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public static int Round(
	this float value
)

Return Value

Type: Int32

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Single. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks

Tests: DeltaEngine.Tests.Extensions.MathExtensionsTests
Examples

1 unit tests call DeltaEngine.Extensions.MathExtensions.Round(System.Single)
[Test]
public static void Round()
{
    Assert.AreEqual(1, 1.25f.Round());
    Assert.AreEqual(10, 9.68f.Round());
    Assert.AreEqual(1.23f, 1.2345f.Round(2));
}
See Also