Truncation
In Java programming, truncation means to trim some digits of a float or double-type number or some characters of a string from the right. We can also truncate the decimal portion completely that makes it an integer. Remember that after truncation, the number will not be round to its nearest value. Hence, truncation is a way of approximation.
It is usually used in computing (especially in database and programming) when division is done with integers and the results must be an integer.
Example
Suppose, a double-type number num=19.87874548973101 is given. It is required that there must be only 3 digits after the decimal point. In such cases, we apply truncation. After truncating the rest digits, we get 19.878.
If we truncate all the digits coming after decimal-point, it becomes 19. If the number has been rounded to the nearest integer it becomes 20.