Excerpt |
---|
Rounds input value to the nearest integer. Input can be an Integer, a Decimal, a column reference, or an expression. Optional second argument can be used to specify the number of digits to which to round. |
- When rounding to nearest integer, decimal values that are
X.5
or more are rounded to X+1
.
Info |
---|
NOTE: This function changes the actual data of the value. If you just want to change how the data is formatted for display, please use the NUMFORMAT function. See NUMFORMAT Function. |
Numeric literal example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value: round(2.5) |
---|
|
round(2.5) |
Output: Rounds the input value to the nearest integer: 3
.
Expression example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value: round(MyValue + 2.5) |
---|
|
round(MyValue + 2.5) |
Output: Rounds to the nearest integer the sum of 2.5 and the value in the MyValue
column.
Numeric literal example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value:round(pi(),4) |
---|
|
round(pi(),4) |
Output: Rounds pi to four decimal points: 3.1416
.
D lang syntax |
---|
RawWrangle | true |
---|
Type | syntax |
---|
showNote | true |
---|
WrangleText | derive type:single value: round(numeric_value, integer_value) |
---|
|
round(numeric_value, integer_value) |
Argument | Required? | Data Type | Description |
---|
numeric_value | Y | string, decimal, or integer | Name of column or Decimal or Integer literal to apply to the function |
integer_value | N | integer | Number of digits to which to round. - Default is
0 , which rounds to the nearest integer. - Negative integer values can be applied.
|
numeric_value
Name of the column, numeric literal, or numeric expression.
- Missing input values generate missing results.
- Literal numeric values should not be quoted. Quoted values are treated as strings.
- Multiple columns and wildcards are not supported.
Required? | Data Type | Example Value |
---|
Yes | String (column reference) or Integer or Decimal literal | 2.5 |
integer_value
Number of digits to which to round the first argument of the function.
- Positive values values truncate to the right of the decimal point.
- Negative values truncate to the left of the decimal point.
- Missing input values generate missing results.
Usage Notes:
Example - Exponential functions
Include Page |
---|
| EXAMPLE - Rounding Functions |
---|
| EXAMPLE - Rounding Functions |
---|
|
Example - RANDBETWEEN and PI and ROUND functions
Include Page |
---|
| EXAMPLE - RANDBETWEEN and PI Functions |
---|
| EXAMPLE - RANDBETWEEN and PI Functions |
---|
|