Overview Rounding

With this function block a value can be rounded up or down and the number of decimal places can be limited. The rounding mode determines how rounding is done: commercial rounding, truncating, rounding down or rounding up. With 0 decimal places and the rounding mode Truncate the integer part of a value is obtained.


Inputs

E1
Input 1
Input

Outputs

A1
Output 1
Result

Parameters

Decimal places
Number of decimal places. Rounding is applied to the last decimal place.
Rounding mode
  • Commercial rounding: the value is rounded to the nearest place (2.4 becomes 2; 2.9 becomes 3). If the value lies exactly halfway, it is rounded to the even place (2.5 becomes 2; 3.5 becomes 4). Use the rounding mode "Round up" if a value should always go up.
  • Truncate: the surplus places are removed without rounding, so it is always rounded towards 0 (2.9 becomes 2; -2.9 becomes -2).
  • Round down: it is always rounded to the next lower place (2.9 becomes 2; -2.1 becomes -3).
  • Round up: it is always rounded to the next higher place (2.1 becomes 3; -2.9 becomes -2).

See also: Modulo, Formula

See also common parameters of all function blocks.