cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Decimal Automatic Rounding on sum

PragyaS
New Contributor

I am facing an issue, I have implemented a code in which I am performing sum on decimal values. I have set precision as Decimal(19,2). When I am calculating for big data I am getting different value as I got from my .Net Utility application. ex. From .Net Utility O/P : 19546.45 and in databricks : 19546.46. I am not sure why databricks is changing values automatically? I need to make sync between .Net utility & databricks data. What is default rounding in decimal precision while doing sum in databricks? Can someone help me for this?

1 ACCEPTED SOLUTION

Accepted Solutions

-werners-
Esteemed Contributor III

I think it is half_up (so starting from 5 round upwards).

with the round() and bround() function you can control the rounding.

View solution in original post

2 REPLIES 2

-werners-
Esteemed Contributor III

I think it is half_up (so starting from 5 round upwards).

with the round() and bround() function you can control the rounding.

Anonymous
Not applicable

Hi @Pragya Sharmaโ€‹ 

We haven't heard from you since the last response from @Werner Stinckensโ€‹  . Kindly share the information with us, and in return, we will provide you with the necessary solution.

 Thanks and Regards

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group