Newer Version Available

This content describes an older version of this product. View Latest

trunc(n[, m])

Returns the value of the numeric expression n truncated to m decimal places. m can be negative, in which case the function returns n truncated to -m places to the left of the decimal point. If m is omitted, it returns n truncated to the integer place. n can be any real numeric value in the range of -1e308 <= n <= 1e308. m can be an integer value between -15 and 15 inclusive.
This example is valid:
1q = foreach q generate trunc(Price, 2) as Price;
These examples are invalid:
1q = group q by trunc(Price, 2);
2q = order q by trunc(Price, 2);