round function in the Factory

The round function returns each value of the column, of continuous type, rounded up or down, depending on their last digits:

  • If the last digit considered is less than 5, then the value is rounded down;

  • If the last digit considered is more than or equal to 5, then the value is rounded up.


Parameters

round(column)

Parameter

Description

column

The attribute used to evaluate the nearest integer value. Its type must be numeral. The column parameter is mandatory.


Example

The following example uses the Top Hits Spotify dataset.

This example isn’t based on a real scenario, it only explains how to use the function.

Description

Screenshot

In this example, we want to add a column which contains the round of the writing score attribute’s values.

Add a new column and type the following formula: round($"tempo")