WEB开发网
开发学院WEB开发ASP.NET c#中的常用ToString()方法 阅读

c#中的常用ToString()方法

 2012-10-12 11:14:14 来源:WEB开发网   
核心提示:Custom number formatting: Specifier Type Example Output (Passed Double 1500.42) Note
Custom number formatting:
Specifier Type Example Output (Passed Double 1500.42) Note
0 Zero placeholder {0:00.0000} 1500.4200 Pads with zeroes.
# Digit placeholder {0:(#).##} (1500).42
. Decimal point {0:0.0} 1500.4
, Thousand separator {0:0,0} 1,500 Must be between two zeroes.
,. Number scaling {0:0,.} 2 Comma adjacent to Period scales by 1000.
% Percent {0:0%} 150042% Multiplies by 100, adds % sign.
e Exponent placeholder {0:00e+0} 15e+2 Many exponent formats available.
; Group separator see below
The group separator is especially useful for formatting currency values which require that negative values be enclosed in parentheses. This currency formatting example at the bottom of this document makes it obvious:

上一页  1 2 3 4 5  下一页

Tags:常用 ToString 方法

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接