cfunc.precision C Function/C Functions

cfunc.precision

Command cfunc.precision C Function/C Functions
Applicable release versions: AP 6.1
Category C Functions (120)
Description equivalent to the Pick/BASIC statement: precision number.

This function affects the precision of the _CP_rs_ and the _CP_sr_ functions.
Syntax void _CP_precision(int number)
Options
Example
CPSTR * s = _CP_mkstr("1.12345");
double r;

_CP_precision(2);
r = _CP_sr_(s);
_CP_unix_env();
printf("%gn", r);
_CP_str_free(s);

 This example displays "1.12" since the conversion is truncated to 
the precision of 2.
Purpose
Related cfunc.introduction
cfunc.rs
cfunc.sr