Formats for Numeric Values
The following formats are supported in the second argument of the TO_NUMBER
function.
Format | Example | Description |
---|---|---|
9 |
999 |
Each 9 represents the position of a digit.
For example, a format of 999 expects up to
three digits in a row. The function returns a result if
the input string has 0, 1, 2, or 3 digits. Digits formatted
as |
0 |
000 |
Each 0 also represents the position of a
digit. However, A format of |
. (period) or D |
999.99 or 999D99 |
Location of the decimal point. You can specify only one period character in the format string. |
, (comma) or G |
9G999D99 or
9,999D99 |
Location of the thousands separator in a number. A format string cannot begin with a comma, and a comma cannot appear to the right of a decimal character or period. |
PR |
9G999D99PR |
The number string represents a negative value, as defined by
the use of angle brackets (for example:
<123.456> ). PR must be
the last element in the format string and cannot be used in
combination with any other signs. |
MI |
9G999D99MI |
Presence of a minus sign, for numbers less than 0.
MI must be the last element in the format
string. Only one sign element can be used in a format
string. |
S |
9G999D99S |
Presence of a sign anchored to the number, either
+ or - . S
must be the first or last element in the format string. Only one
sign element can be used in a format string. |
V |
9G999V99 |
This format divides the input values by
10^n , where n is the number of
digits following V .
|