2014年6月3日 星期二

VB.net 字串格式 Format

Format是VB.Net中很好用,不需死記參數,很人性化的格式化Function,舉例:
123456789 (三位一撇千分位)
Format(123456789, "###,###")    OutPut ; 123,456,789
0.2666666 (小數點後兩位,四捨五入,並加上%)
Format(0.2666666,"0.00%")         OutPut  : 26.67%
 千分位,小數點捨去
Format(Val(strValue.ToString), "###,##0")


1 則留言:

  1. I was surfing net and fortunately came across this site and found very interesting stuff here. Its really fun to read. I enjoyed a lot. Thanks for sharing this wonderful information. view

    回覆刪除