回复 4楼tenjin的帖子
Note: Formatting of values is done on the client-side using globalize.min.js library. Use formatting patterns supported by that library, for more information on the library please check https://github.com/jquery/globalize
Examples:
"n" - displays numeric values in number format.
"d" - displays numeric values in decimal format.
"d" - displays date values in short date format.
///
"p" - displays numeric values in percentage format.
"c" - displays numeric values in currency format.
(C1GridView1.Columns[0] as C1BoundField).DataFormatString = "d0";
(C1GridView1.Columns[4] as C1BoundField).DataFormatString = "yyyy-MM-dd";
效果截图:
具体例子:
// just for example - will vary by culture
Globalize.format( 123.45, "n" ); // 123.45
Globalize.format( 123.45, "n0" ); // 123
Globalize.format( 123.45, "n1" ); // 123.5
Globalize.format( 123.45, "d" ); // 123
Globalize.format( 12, "d3" ); // 012
Globalize.format( 123.45, "c" ); // $123.45
Globalize.format( 123.45, "c0" ); // $123
Globalize.format( 123.45, "c1" ); // $123.5
Globalize.format( -123.45, "c" ); // ($123.45)
Globalize.format( 0.12345, "p" ); // 12.35 %
Globalize.format( 0.12345, "p0" ); // 12 %
Globalize.format( 0.12345, "p4" ); // 12.3450 % |