Entering content frame

 round_or_trunc_spec 

Syntax Rules for Column Descriptions

Syntax

<round_or_trunc_spec> ::= ROUND <valFRACTION> | TRUNC <valFRACTION>

valFRACTION

Number of decimal places

The value must be between 0 and 18. This function doe not have any effect if the number does not have any decimal places.

Use

Use this syntax rule to specify the number of decimal places in a number.

ROUND <valFRACTION>

The value is rounded off at the (<valFRACTION>+1) th decimal place. If this number is >= 5, the value is rounded up. If it is < 5, the value is rounded down. The result is a number in which the (<valFRACTION>+1)th and all subsequent decimal places are equal to 0. The other digits in the number may have been changed if the value was rounded up.

DATALOAD TABLE distance
  ...
  cm 7 SCALE 2
  cm 7 SCALE -3 ROUND 1
...
INFILE 'meter.data'

TRUNC <valFRACTION>

The (<valFRACTION>+1)th and all subsequent decimal places of the value are set to 0. The first <valFRACTION> decimal places remain unchanged.

DATAEXTRACT * FROM distance
  cm    10-14 INTEGER SCALE 2
  m     14-17 INTEGER
  km    18-21 INTEGER SCALE -3 TRUNC 2

OUTFILE 'dimensions.bin' FORMATTED

Leaving content frame