round#

swordfish.function.round()#

Round a number to the specified number of digits after the decimal point with the round half up rule.

In comparison, functions floor and ceil map a number to the largest previous or the smallest following integer, respectively.

Parameters:
  • X (Constant) – A scalar/vector/matrix.

  • precision (Constant, optional) – An integer indicating the number of digits (up to 10) after the decimal point. The default value is 0.