您的位置:首页 > 其它

Some Useful Examples(String.Format)

2012-09-25 11:19 246 查看

Some Useful Examples

String.Format("{0:$#,##0.00;($#,##0.00);Zero}", value);


This will output "$1,240.00" if passed 1243.50. It will output the same format but in parentheses if the number is negative, and will output the string "Zero" if the number is zero.


String.Format("{0:(###) ###-####}", 18005551212);


This will output "(800) 555-1212".

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: