DataBasic Reference > Statements and Intrinsic Functions > T > TRUNC Function

Comment on this topic

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.

RealityV15.1Online Documentation (MoTW) Revision 7

TRUNC Function (DataBasic) (m618703+trunc_f.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

TRUNC Function

Truncates a numeric variable or string to a specified number of decimal places. See also the ROUND function.

Syntax

TRUNC(number, places)

Syntax Elements

number is the numeric variable or string.

places is the number of decimal places that will be retained after truncation.

Operation

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.

Example

A = 153.5673
B = TRUNC(A,2)
PRINT B

prints 153.56.

RealityV15.1 (MoTW) Revision 7Comment on this topic