close
DataBinder.Eval  格式

//二位小數
//

//{0:G}代表True或False

轉換類型

Specifier Type     Format   Output (Passed Double 1.42)  Output (Passed Int -12400)
c  Currency        {0:c}     $1.42     -$12,400
d  Decimal         {0:d}    System.FormatException  -12400
e  Scientific      {0:e}    1.420000e+000    -1.240000e+004
f  Fixed point     {0:f}  1.42    -12400.00
g  General         {0:g}  1.42     -12400
n  Number with commas for thousands  {0:n}  1.42     -12,400
r  Round trippable    {0:r}  1.42     System.FormatException
x  Hexadecimal    {0:x4}  System.FormatException   cf90


{0:d} 日期只顯示年月日
{0:yyyy-mm-dd} 按格式顯示年月日

樣式 取決 Web.config 中的設置

{0:c}  或 {0:£0,000.00} 貨幣樣式  標準英國貨幣樣式

      culture="en-US" uiCulture="en-US"/> />
/>
顯示為 £3,000.10

{0:c}  或 string.Format("{0:C}", price); 中國貨幣樣式

      culture="zh-cn" uiCulture="zh-cn"/> />
/>
顯示為 ¥3,000.10

{0:c}  或 string.Format("{0:C}", price); 美國貨幣樣式

     
/>
顯示為 $3,000.10


馬上加入有廣告下線的廣告!!

幫你點廣告!!

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 11 的頭像
    11

    冠霖的部落格

    11 發表在 痞客邦 留言(0) 人氣()