-
Notifications
You must be signed in to change notification settings - Fork 125
feat: standard database functions everywhere #1750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
8cdad22
dc8994b
fa71952
f6a4de8
cea35b4
4ce5eaf
ad564e1
7cb9ea3
6c4b0c9
655939d
9bf08ae
2ba678d
fba6aab
096010c
46385f9
e9a63f8
1fc02aa
9696cb6
bdabd63
2322e91
0704002
0bdfb5a
31e9d4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -986,6 +986,12 @@ by deviating from the casing given below. | |
- `round(x)` | ||
Rounds the numeric parameter to the nearest integer. | ||
The midpoint between two integers is rounded away from zero (e.g., `0.5` → `1` and `-0.5` → `-1`). | ||
|
||
::: warning `round` function with more than one argument | ||
please note that most databases support `round` functions with multiple arguments. | ||
The second parameter being the precision. SAP HANA even has a third argument which is the rounding mode. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found that using a negative precision does not work on SQLite. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we only take care of the one argument variant of the
patricebender marked this conversation as resolved.
Show resolved
Hide resolved
|
||
If you provide more than one argument, the `round` function may behave differently depending on the database. | ||
::: | ||
|
||
#### Date and Time Functions | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x
?Int32
?Int64
?round
with two parameters where the second parameter which indicates the number of digits to round to. There are issues on SQLite with this second parameter. I assume there is no plan to support the method with two parameters.Double
elements rounds to the nearest even integerhttps://www.postgresql.org/docs/16/functions-math.html
Rounds to nearest integer. For numeric, ties are broken by rounding away from zero. For double precision, the tie-breaking behavior is platform dependent, but “round to nearest even” is the most common rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Java: