Results of a FORMAT Phrase Defining Too Few Positions

Teradata Vantage™ Data Types and Literals

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1143-162K

A FORMAT phrase that defines fewer positions than are required by numeric values causes the data to be returned as follows:

  • Asterisks appear when the integer portion cannot be accommodated.
  • When only the integer portion can be accommodated, any digits to the right of the least significant digit are either truncated (for an integer value) or rounded (for a floating, number, or decimal value).

Rounding is based on “Round to the Nearest” mode, as illustrated by the following process.

  1. Let B represent the actual result.
  2. Let A and C represent the nearest bracketing values that can be represented, such that A < B < C.
  3. The determination as to whether A or C is the represented result is made as follows
    1. When possible, the result is the value nearest to B.
    2. If A and C are equidistant (for example, the fractional part is exactly .5), the result is the even number.