|
Purpose |
Truncates a double-precision number after a specified number of decimal places | ||
|
Old name |
#define trunc_number tf_trunc_number | ||
|
Syntax |
double trunc_number(number, decimal_places) | ||
|
Parameters |
double number |
Double-precision number to be truncated | |
|
|
int decimal_places |
Number of decimal places to use for truncation | |
|
Description |
The tf_trunc_number() function truncates a double-precision number to the number of decimal places given. All the digits after the decimal place given are truncated to zero. For example, the call: tf_trunc_number(3.149, 2); returns 3.14. | ||
|
Return values |
Returns a truncated double-precision number | ||
|
See also |
|||
|
Example |
| ||