![]() |
|
The dectrunc() function truncates a rounded decimal type number to fractional digits.
The following table shows the sample output from dectrunc() with various inputs.
Value Before Truncation | Value of s | Truncated Value |
---|---|---|
1.4 | 0 | 1.0 |
1.5 | 0 | 1.0 |
1.684 | 2 | 1.68 |
1.685 | 2 | 1.68 |
1.685 | 1 | 1.6 |
1.685 | 0 | 1.0 |
The file dectrunc.ec in the demo directory contains the following sample program.