-
Notifications
You must be signed in to change notification settings - Fork 5.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
double/real truncation incorrect #14693
Comments
I'm not particularly sure if SQL spec has definition about how truncate is supposed to work. If it is up to the engine implementation, then it sounds fine. |
Thanks for the feedback. looks like oracle and other ansi-sql db vendors only keeps the number of digits of the decimal point per specified input d. |
If most other databases remove trailing 0 we can change the behavior. Not sure what's the migration implications. @kaikalur thoughts? |
Spec doesn't say anything about this. Looks like it's totally implementation dependent. |
Truncation of a decimal number leaves the precision as it was.
![image](https://user-images.githubusercontent.com/32091981/85261413-f9231300-b420-11ea-9099-c0a418a08981.png)
Proposed Solution:
Fix in MathFunctions truncate(num,d) to drop double's precision digits after decimal point based on the value of d
The text was updated successfully, but these errors were encountered: