Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.0 ()
TRUNC Function (DataBasic) (m618703+trunc_f.htm)
Truncates a numeric variable or string to a specified number of decimal places. See also the ROUND function.
TRUNC(number, places)
number is the numeric variable or string.
places is the number of decimal places that will be retained after truncation.
If the number of decimal places exceeds the current precision, TRUNC will affect only those numbers that have not already been shortened as a result of operations determined by the PRECISION statement.
Negative numbers are treated similarly (unwanted decimal places are discarded), but the sign is retained.
A = 153.5673
B = TRUNC(A,2)
PRINT B
prints 153.56.