Because of the many built-in functions provided by Apache Hive, the job made it easy for analysts, developers and programmers in most instances. Instead of using casting/converting functions to transform the integer values to decimal values, Hive provided a direct function that helps in those situations.
Syntax: FORMAT_NUMBER(number x, int d)
Formats the number X to a format like ‘#,###,###.##’, rounded to D decimal places, and returns the result as a string. If D is 0, the result has no decimal point or fractional part.
Example:
SELECT FORMAT_NUMBER(12345678,2)
This returns 12,345,678.00
Hope you liked this post.
Please click on the follow button to receive updates on latest posts.
2 comments