If dataformatstring is invalid, add the htmlencode = "false" attribute"
---------------------------------------
The syntax of the dataformatstring attribute is as follows: dataformatstring = "{0: Format String}" We know {0} In dataformatstring}
Represents the data itself, and the format string after the colon represents the format that we want the data to display; in addition, after the specified format symbol, you can specify the number of digits to be displayed in decimal places. For example, the original data is
"1.56". If the format is set to {0: N1}, "1.5" is output 」. The commonly used numeric format is shown in the following table: 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 formats are shown in the following table: format description output format D simplified Date Format mm/DD/yyyyd detailed Date Format dddd, Mmmm DD, yyyyf complete format (long date + short time) dddd, Mmmm DD, yyyy hh: mmf full Date and Time Format (long date + long time) dddd, Mmmm DD, yyyy hh: mm: SSG general format (short date + short time) mm/DD/YYYY hh: MMG general format (short date + long time) mm/DD/YYYY hh: mm: SSM, M month/day format mmmm DDS moderate Date Format yyyy-mm-dd hh: mm: SST simplified time format hh: MT 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") %>
The exact digits after the decimal point in the date format of gridview and dataformatstring