informix
INFORMIX-ESQL/C Programmer's Manual
ESQL/C Function Library

dectrunc()

The dectrunc() function truncates a rounded decimal type number to fractional digits.

Syntax

Usage

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

Example

The file dectrunc.ec in the demo directory contains the following sample program.

Output


INFORMIX-ESQL/C Programmer's Manual, Version 9.21
Copyright © 1999, Informix Software, Inc. All rights reserved