Skip to content

dos_trunc

Dale Fugier edited this page Nov 1, 2023 · 1 revision

Truncates a number to a specified number of decimal places.

Syntax

(dos_trunc number [precision])

Parameters

number

The number.

precision

The precision of the truncation. The default value precision is 0 (zero).

Returns

The truncated number, if successful.

nil on error.

Example

Command: (dos_trunc (dos_pi))
3
Command: (dos_trunc (dos_pi) 1)
3.1
Command: (dos_trunc (dos_pi) 2)
3.14
Command: (dos_trunc (dos_pi) 3)
3.141
Clone this wiki locally