cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

What is the equivalent function to oracle trunc() for numerics in databricks?

Hemanth998
New Contributor
 
1 ACCEPTED SOLUTION

Accepted Solutions

Aashita
Contributor III
Contributor III

@Hemanth​ , example :

spark.sql("select substring(25.45678,0, instr(25.45678,'.')+2) as out").show()
 

will give

View solution in original post

3 REPLIES 3

Aashita
Contributor III
Contributor III

@Hemanth​ , example :

spark.sql("select substring(25.45678,0, instr(25.45678,'.')+2) as out").show()
 

will give

@Hemanth​  does it work now?

Kaniz
Community Manager
Community Manager

Hi @Hemanth​ , Just a friendly follow-up. Do you still need help, or @Aashita Ramteke​ 's response help you to find the solution? Please let us know.

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.