TO_NUMBER format_arg Format Elements - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
Format Element Example Returned Value
, (comma) 9,999 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 Decimal point.

You can only specify one period in a number format.

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

9990

Leading zeros.

trailing zeros.

9 9999 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 ISO currency symbol as specified in the ISOCurrency element in the SDF file.
D 99D99 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 Value in scientific notation.
G 9G999 Group separator (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 (string representing the local currency as specified in the Currency element in the SDF file).
MI 9999MI 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 Negative value in angle brackets (< and >), or

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 Negative value with a leading or trailing minus sign.

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 (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 (string that represents the dual currency as specified in the DualCurrency element in the SDF file).
V 999V99 Value multiplied by 10 to the n (and, if necessary, rounded up), where n is the number of 9s after the V.
X XXXXX xxxxx Hexadecimal value of the specified number of digits. The function rounds a specified noninteger number 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 has one leading blank.