Data Binding-dataformatstring
Set the dataformatstring of boundfield. There are usually the following types:
Dataformatstring = "{0: c}" currency. The format of the currency depends on the settings of the culture in the current thread.
Dataformatstring = "{0: e}" scientific notation
Dataformatstring = "{0: p}" percentage
Dataformatstring = "{0: F ?} "Number of decimal places
Dataformatstring = "{0: d}" m/D/YYYY, for example, 10/30/2008
Dataformatstring = "{0: f}" long date, short time. Dddd, Mmmm DD, yyyy hh: mm AA such as, Monday, january30, 2008 AM
Dataformatstring = "{0: d}" long date. Dddd, Mmmm DD, yyyy such as: Monday, January
Dataformatstring = "{0: f}" long date, long time dddd, Mmmm DD, yyyy hh: mm: SS AA
Dataformatstring = "{0: s}" ISO Standard Time. Yyyy-mm-ddthh: mm: SS, for example, 2008-01-30t10: 20: 55am
Dataformatstring = "{0: m}" month and date mmmm DD, such as january30
Dataformatstring = "{0: g}" General Format: M/D/YYYY hh: mm: SS AA
-----------------------------------------------------------------
Format String input result
"{0: c}" 12345.6789 $12,345.68
"{0: c}"-12345.6789 ($12,345.68)
"{0: d}" 12345 12345
"{0: D8}" 12345 00012345
"{0: e}" 12345.6789 1234568e + 004
"{0: E10 }" 12345.6789 1.2345678900e + 004
"{0: F }" 12345.6789 12345.68
"{0: F0 }" 12345.6789 12346
"{0: g}" 12345.6789 12345.6789
"{0: G7}" 123456789 1.234568e8
"{0: n}" 12345.6789 12,345.68
"{0: N4}" 123456789 123,456,789.0000
"Total: {0: c}" 12345.6789 total: $12345.68
Common Date and Time formats:
Format description output format
D. Simplified Date Format: mm/DD/YYYY
D detailed Date Format: dddd, Mmmm DD, yyyy
F full format (long date + short time) dddd, Mmmm DD, yyyy hh: mm
F
Complete Date and Time Format
(Long date + long time)
Dddd, Mmmm DD, yyyy hh: mm: SS
G General Format (short date + short time) mm/DD/YYYY hh: mm
G General Format (short date + long time) mm/DD/YYYY hh: mm: SS
M, M month/day format mmmm dd
S moderate Date and Time Format: yyyy-mm-dd hh: mm: SS
T simplified time format hh: mm
T detailed time format hh: mm: SS
<% # String. Format ("{0: yyyy-mm-dd}", Eval ("inclutivedate") %>
<% # String. Format ("{0: yyyy-m-d}", databinder. eval (container. dataitem, "effectivedate") %>