-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add support for rounding negative decimal places #1689
Conversation
presto-main/src/main/java/io/prestosql/operator/scalar/MathFunctions.java
Outdated
Show resolved
Hide resolved
@jlabarbera11 Thanks for addressing this issue! |
bf38ea4
to
2f251a5
Compare
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.
@jlabarbera11 thanks for working on this!
some comments
presto-main/src/test/java/io/prestosql/operator/scalar/TestMathFunctions.java
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/operator/scalar/TestMathFunctions.java
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/scalar/MathFunctions.java
Outdated
Show resolved
Hide resolved
|
||
double factor = Math.pow(10, -decimals); | ||
if (factor > Long.MAX_VALUE) { | ||
throw new PrestoException(NUMERIC_VALUE_OUT_OF_RANGE, "decimal overflow: " + decimals); |
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.
this will need improvement, but i need to think about this yet
presto-main/src/test/java/io/prestosql/operator/scalar/TestMathFunctions.java
Show resolved
Hide resolved
2f251a5
to
537d009
Compare
537d009
to
5e60ce9
Compare
Merged as b91aeaf, thanks! (i added 5 more test cases) |
addresses #42