Format expression Applied to this data type Description
Price: {0:C}
Note The {0} is a zero, not the letter O. numeric/decimal Displays the literal "Price:" followed by numbers in currency format. The currency format depends on the culture setting specified via the culture attribute on the Page directive or in the Web.config file.
{0:D4} integer (Cannot be used with decimal numbers.) Integers are displayed in a zero-padded field four characters wide.
{0:N2}% numeric Displays the number with 2-decimal place precision followed by the literal "%".
{0:000.0} numeric/decimal Numbers rounded to one decimal place. Numbers less than three digits are zero padded.
{0:D} date/datetime Long date format ("Thursday, August 06, 1996"). Date format depends on the culture settting of the page or the Web.config file.
{0:d} date/datetime Short date format ("12/31/99").
{0:yy-MM-dd} date/datetime Date in numeric year-month-day format (96-08-06).
Price: {0:C}
Note The {0} is a zero, not the letter O. numeric/decimal Displays the literal "Price:" followed by numbers in currency format. The currency format depends on the culture setting specified via the culture attribute on the Page directive or in the Web.config file.
{0:D4} integer (Cannot be used with decimal numbers.) Integers are displayed in a zero-padded field four characters wide.
{0:N2}% numeric Displays the number with 2-decimal place precision followed by the literal "%".
{0:000.0} numeric/decimal Numbers rounded to one decimal place. Numbers less than three digits are zero padded.
{0:D} date/datetime Long date format ("Thursday, August 06, 1996"). Date format depends on the culture settting of the page or the Web.config file.
{0:d} date/datetime Short date format ("12/31/99").
{0:yy-MM-dd} date/datetime Date in numeric year-month-day format (96-08-06).
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货