diff --git a/modules/ROOT/pages/functions/mathematical-numeric.adoc b/modules/ROOT/pages/functions/mathematical-numeric.adoc index d3457f98c..441130d14 100644 --- a/modules/ROOT/pages/functions/mathematical-numeric.adoc +++ b/modules/ROOT/pages/functions/mathematical-numeric.adoc @@ -277,7 +277,7 @@ A random number is returned. [[functions-round]] == round() -`round()` returns the value of the given number rounded to the nearest integer, with half-way values always rounded up. +`round()` returns the value of the given number rounded to the nearest integer, with ties always rounded towards positive infinity. *Syntax:* @@ -335,11 +335,31 @@ RETURN round(3.141592) ====== +.+round() of negative number with tie+ +====== + +.Query +[source, cypher, indent=0] +---- +RETURN round(-1.5) +---- + +Ties are rounded towards positive infinity, therfore `-1.0` is returned. + +.Result +[role="queryresult",options="header,footer",cols="1*> without precision. *Syntax:* @@ -373,12 +393,12 @@ round(expression, precision) |=== -| `round(null)` returns `null`. +| `round()` returns `null` if any of its input parameters are `null`. |=== -.+round()+ +.+round() with precision+ ====== .Query @@ -401,6 +421,52 @@ RETURN round(3.141592, 3) ====== +.+round() with precision 0 and tie+ +====== + +.Query +[source, cypher, indent=0] +---- +RETURN round(-1.5, 0) +---- + +To align with `round(-1.5)`, `-1.0` is returned. + +.Result +[role="queryresult",options="header,footer",cols="1*