# pig tutorial - apache pig tutorial - Apache Pig ROUND() - pig latin - apache pig - pig hadoop

## What is ROUND() function in Apache Pig ?

• The ROUND() function returns a number rounded to a given number of digits.
• The ROUND() function can round to the right or left of the decimal point.
• The ROUND() function is used to get the value of an expression rounded to an integer (if the result type is float) or rounded to a long (if the result type is double). Learn Apache Pig - Apache Pig tutorial - Apache Pig round - Apache Pig examples - Apache Pig programs

## Example

• Ensure that we have a file named wikitechy_math.txt in the HDFS directory /pig_data/.
• This file contains integer and floating point values as given below.

wikitechy_math.txt

• You have loaded this file into Pig with a relation named math_data as given below.
• Now you can calculate round values of the contents of the wikitechy_math.txt file using ROUND() function as given below.

## Verification

• Verify the contents of the relation using the Dump operator as given below.

## Output

• · The above statement stores the result in the relation named round_data.
{"ft_lang_label":"__label__en","ft_lang_prob":0.66214746,"math_prob":0.89176226,"size":1134,"snap":"2020-34-2020-40","text_gpt3_token_len":246,"char_repetition_ratio":0.15309735,"word_repetition_ratio":0.010050251,"special_character_ratio":0.22751322,"punctuation_ratio":0.06532663,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9871176,"pos_list":[0,1,2],"im_url_duplicate_count":[null,5,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-08-15T10:50:24Z\",\"WARC-Record-ID\":\"<urn:uuid:dbf76aef-cf21-4d81-be32-30e0ae60d3f7>\",\"Content-Length\":\"73374\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:cac1c896-2438-4dc3-b37d-23002befe3cd>\",\"WARC-Concurrent-To\":\"<urn:uuid:786095ac-9dfe-4457-a24c-eb3c250523b7>\",\"WARC-IP-Address\":\"104.27.166.234\",\"WARC-Target-URI\":\"https://www.wikitechy.com/tutorials/apache-pig/apache-pig-round\",\"WARC-Payload-Digest\":\"sha1:D2KT4YACN46JUKGPE246KJMBTRFNH4TO\",\"WARC-Block-Digest\":\"sha1:GMMZQGJRHSD2AHAWIMHQMXZ5MBLSYM6J\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-34/CC-MAIN-2020-34_segments_1596439740838.3_warc_CC-MAIN-20200815094903-20200815124903-00382.warc.gz\"}"}