format_arg Format Elements - 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™
Format Element… Example... Returns …
, (comma) 9,999 a comma in the specified position.
  • A comma cannot begin a number format.
  • A comma cannot appear to the right of a decimal character or period in a number format.
. (period) 9.99 a decimal point.

You can only specify one period in a number format.

$ $9999 a value with a leading dollar sign.
0 09999

9990

leading zeros.

trailing zeros.

9 9999 a value with the specified number of digits with a leading space if positive or with a leading minus if negative.
B B9999 blanks for the integer part of a fixed point number when the integer part is zero.
C C999 the ISO currency symbol as specified in the ISOCurrency element in the SDF file.
D 99D99 the character that separates the integer and fractional part of non-monetary values.

This is specified in the RadixSeparator element in the SDF file.

EEEE 9.9EEEE a value in scientific notation.
G 9G999 (group separator) the character that separates groups of digits in the integer part of non-monetary values.

This is specified in the GroupSeparator element in the SDF file.

L L999 (local currency) the string representing the local currency as specified in the Currency element in the SDF file.
MI 9999MI a trailing minus sign if the value is negative.

The MI format element can appear only in the last position of a number format.

PR 9999PR a negative value in <angle brackets>, or

a positive value with a leading and trailing blank.

The PR format element can appear only in the last position of a number format.

S S9999
9999S a negative value with a leading or trailing minus sign.

a positive value with a leading or trailing plus sign.

The S format element can appear only in the first or last position of a number format.

TM TM

TM9

TME

(text minimum format) returns the smallest number of characters possible.This element is case insensitive.

TM or TM9 return the number in fixed notation unless the output exceeds 64 characters. If the output exceeds 64 characters, the number is returned in scientific notation.

TME returns the number in scientific notation with the smallest number of characters.

You cannot precede this element with an other element. You can follow this element only with one 9 or one E (or e), but not with any combination of these.

U U9999 (dual currency) the string that represents the dual currency as specified in the DualCurrency element in the SDF file.
V 999V99 a value multiplied by 10 to the n (and, if necessary, rounded up), where n is the number of 9's after the V.
X XXXXX
xxxxx the hexadecimal value of the specified number of digits. If the specified number is not an integer, the function will round it to an integer.

This element accepts only positive values or zero. Negative values return an error. You can precede this element only with zero (which returns leading zeros) or FM. Any other elements return an error. If you do not specify zero or FM, the return always has one leading blank.