Results of a FORMAT Phrase Defining Too Few Positions | Teradata Vantage - 17.10 - Results of a FORMAT Phrase Defining Too Few Positions - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Data Types and Literals

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)
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.