[]
        
(Showing Draft Content)

C1.CalcEngine.ExpressionEngine.MathFunctions.Round

Round Method

Round(List<IExpression>)

Rounds a numeric value to the specified number of decimal places using an optional rounding mode.

Declaration
public static object Round(List<IExpression> source)
Public Shared Function Round(source As List(Of IExpression)) As Object
Parameters
Type Name Description
List<IExpression> source

An array of arguments:

  • [0] – The numeric value to round.
  • [1] – The number of decimal places.
  • [2] (optional) – The rounding mode. If omitted or unknown, the default mode is used.

Nearest modes (round to the nearest value; differ only on exact ties):

  • "banker", "toeven", "halfeven" (default) – Rounds ties to the nearest even value (HALF_EVEN).
  • "halfup", "awayfromzero" – Rounds ties away from zero (HALF_UP).
  • "halfdown" – Rounds ties toward zero (HALF_DOWN).

Directed modes (always round in a fixed direction):

  • "up" – Rounds away from zero for all values (UP). Note: this is not the same as "halfup".
  • "down", "truncate", "tozero" – Rounds toward zero (DOWN).
  • "ceiling", "ceil" – Rounds toward positive infinity (CEILING).
  • "floor" – Rounds toward negative infinity (FLOOR).
Returns
Type Description
object