Database Reference
In-Depth Information
Table 9.2
Some of the Number Formatting Models
Number Format Models
What Is It?
9,999,999
Delimit thousands with commas (1000000 shows
1,000,000).
99.99
Number of decimal places (95.3359 shows 95.34).
$9999
Display a leading $ sign (1000 shows $1000).
09999, 99990
Leading and trailing zeros (05633 shows 05633).
99999
Format to a specified number of numerals (05633 shows
5633).
B9999.99
Integer shown as blanks (0.99 shows .99).
C999
Leading ISO currency symbol (839 shows USD839).
9.9EEEE
Scientific notation (2000000 shows 2.0E+06).
9999MI
Negative value has a trailing minus sign and positive a
trailing blank (-500 shows 500-).
9999PR
Negative value in <999> and positive with a leading and
trailing blank (-500 shows <500>).
S9999, 9999S
S replaces negative value with a minus sign or positive
sign depending on value (-500 shows -500 and 500
shows +500).
RN, rn
Roman numerals in upper or lowercase (2002 shows
MMII).
A number format implies a display format imposed on a number when
that number is converted to a string using the TO_CHAR function. The
conversion is required in order to format the number into an easily readable
form. Some of the available number conversion format modifiers are shown
in Table 9.2.
9.2.4.2
Date Conversion Function Formats
The TO_DATE(date[, format]) and TO_CHAR(date [, format]) functions
are used to convert between strings and dates. Converting a date to a string
requires that the string is a string representation of a date. As with the
ROUND, TRUNC, and number conversion functions, there are numerous
applicable formatting rules. Table 9.3 shows some of the date conversion
format modifiers.
 
Search WWH ::




Custom Search