cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.