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.