Number Format Models
Use number format models in the following functions:
-
In the
TO_CHAR
function to translate a value ofNUMBER
,BINARY_FLOAT
, orBINARY_DOUBLE
data type toVARCHAR2
data type. -
In the
TO_NUMBER
function to translate a value ofCHAR
orVARCHAR2
data type toNUMBER
data type.
The default american_america
NLS language and territory setting is used.
A number format model is composed of one or more number format elements. The table lists the elements of a number format model. Negative return values automatically contain a leading negative sign and positive values automatically contain a leading space unless the format model contains the MI
, S
, or PR
format element.
Table 3-1 Number format elements
Element | Example | Description |
---|---|---|
|
|
Returns a comma in the specified position. You can specify multiple commas in a number format model. Restrictions:
|
|
|
Returns a decimal point, which is a period (.) in the specified position. Restriction: You can specify only one period in a format model. |
$ |
|
Returns value with leading dollar sign. |
|
|
Returns leading zeros. Returns trailing zeros. |
|
|
Returns value with the specified number of digits with a leading space if positive or with a leading minus if negative. Leading zeros are blank, except for a zero value, which returns a zero for the integer part of the fixed-point number. |
|
|
Returns blanks for the integer part of a fixed-point number when the integer part is zero (regardless of zeros in the format model). |
|
|
Returns in the specified position the ISO currency symbol. |
|
|
Returns the decimal character in the specified position. The default is a period ( Restriction: You can specify only one decimal character in a number format model. |
|
|
Returns a value in scientific notation. |
|
|
Returns the group separator in the specified position. You can specify multiple group separators in a number format model. Restriction: A group separator cannot appear to the right of a decimal character or period in a number format model. |
|
|
Returns the local currency symbol in the specified position. |
|
|
Returns negative value with a trailing minus sign ( Returns positive value with a trailing blank. Restriction: The |
|
|
Returns negative value in angle brackets ( Returns positive value with a leading and trailing blank. Restriction: The |
|
|
Returns a value as Roman numerals in uppercase. |
|
|
Returns a value as Roman numerals in lowercase. Value can be an integer between 1 and 3999. |
|
|
Returns negative value with a leading minus sign ( Returns positive value with a leading plus sign ( |
|
|
Returns negative value with a trailing minus sign ( Returns positive value with a trailing plus sign ( Restriction: The |
|
|
The text minimum number format model returns (in decimal output) the smallest number of characters possible. This element is case insensitive. The default is Restrictions:
|
|
|
Returns the euro or other dual currency symbol in the specified position. |
|
|
Returns a value multiplied by 10n (and if necessary, rounds it up), where |
|
|
Returns the hexadecimal value of the specified number of digits. If the specified number is not an integer, then TimesTen rounds it to an integer. Restrictions:
|