TO_CHAR
function formats a number into a string using a given format.
TO_CHAR
function is as follows:
value
: A number that will be formatted to a string.format
: The format of the input string.Pattern | Description |
---|---|
9 | Digit position (may be dropped if insignificant) |
0 | Digit position (never dropped) |
. | Decimal point |
, | Group (thousands) separator |
D | Decimal point |
G | Group separator |
S | Plus/minus sign directly before or after a number |
PL | Plus sign in the specified position (for negative numbers) |
MI | Minus sign in specified position (for positive numbers) |
SG | Plus/minus sign in the specified position. |
"{text}"
will not be considered a pattern.""
will not appear in the result string.