C#数值格式
示例
//整数类型为十六进制
string.Format("Hexadecimal: byte2: {0:x2}; byte4: {0:X4}; char: {1:x2}", 123, (int)'A');
//带有千位分隔符的整数
string.Format("Integer, thousand sep.: {0:#,#}; fixed length: >{0,10:#,#}<", 1234567);
//带有前导零的整数
string.Format("Integer, leading zeroes: {0:00}; ", 1);
//小数点
string.Format("Decimal, fixed precision: {0:0.000}; as percents: {0:0.00%}", 0.12);输出:
Hexadecimal: byte2: 7b; byte4: 007B; char: 41 Integer, thousand sep.: 1,234,567; fixed length: > 1,234,567< Integer, leading zeroes: 01; Decimal, fixed precision: 0.120; as percents: 12.00%
热门推荐
1 训练狗狗基础
2 怎么训练狗狗笑
3 怎么训练狗狗卧下
4 上海狗狗训练基地
5 训练狗狗排便
6 狗狗基础训练
8 如何训练狗狗装死
9 狗狗站姿训练
10 狗狗训练用品
11 训练狗狗吧
12 狗狗要怎么训练
13 怎么训练狗狗玩球
14 训练狗狗唤回
15 狗狗训练躺下
16 狗狗训练指令
17 狗狗的训练技巧
18 狗狗不好训练