ASP. NET 2.0 improves the Data Binding operation in the template. It simplifies the Data Binding syntax databinder. eval (container. dataitem, fieldname) in v1.x to eval (fieldname ). The eval method, like databinder. Eval, can accept an optional
C # formatting the numeric result table (formatting strings)
Character
Description
Example
Output
C
Currency
String. Format("{0: C3}", 2)
$2.000
D
Decimal
String. Format("{0: D3}", 2)
002
Zeichenketten und datumswerte formatieren
Oft komt es vor, dass man zeichenketten und datumswerte in einem bestimmten format ausgeben muss. das Microsoft framework stellt eine mächte methode zur Verf ügung mit der man einfach und
Format description
Name
Description
D
Short date mode
Displays
The pattern defined by the datetimeformatinfo. shortdatepattern attribute or the pattern defined by the provider in the specified format.
D
Long date
In the development of a serial communication program, using the need to convert 10 to 16 binary, the following class capacity is referenced:From:http://www.cnblogs.com/xdotnet/archive/2009/01/17/tostring_format.htmlWhen many objects are displayed as
"Turn" http://blog.csdn.net/samsone/article/details/75567811. Formatted currency (related to system environment, Chinese system default format RMB, English system format USD)String. Format ("{0:c}", 0.2) results are: ¥0.20 (English operating system
Date conversion OneIn order to achieve different display effects sometimes we need to convert the time, the default format is: 2007-01-03 14:33:34, to convert to another format, to use the DateTime.ToString method (String, IFormatProvider), As shown
examples of C # String.Format STRINGSTR1=string. Format ("{0:N1}",56789);//result:56,789.0STRINGSTR2 =string. Format ("{0:N2}",56789);//result:56,789.00STRINGSTR3 =string. Format ("{0:N3}",56789);//result:56,789.000STRINGSTR8 =string. Format ("{0:F1}
1. Formatted currency (related to system environment, Chinese system default format RMB, English system format USD)String. Format ("{0:c}", 0.2) results are: ¥0.20 (English operating system results: $0.20)The default formatting retains two decimal
Format () Basic syntax:???? {index [, align] [: format string]}????· Index: Represents the nth object parameter in a list of referenced objects.????· Align (optional): Sets the width and alignment, which is a signed integer. Positive numbers are
int a = 12345678;Format is sring outputLabel1.Text = string. Format ("Asdfadsf{0}adsfasdf", a);Label2.Text = "ASDFADSF" +a.tostring () + "ADSFASDF";Label1.Text = string. Format ("Asdfadsf{0:c}adsfasdf", a);//ASDFADSF¥1,234.00ADSFASDFLabel2.Text =
New input controls for form:
Name
Description
Legend
Email
e-mail text box, showing no difference from normal
Tel
Phone number ,pc side will not have obvious changes, but the mobile
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.