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

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
tpf1598412463935.ditamap
dita:ditavalPath
tpf1598412463935.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantage™
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.