I recently encountered some format conversion problems during encryption and decryption. I pasted the msdn example. For details:
Http://msdn.microsoft.com/zh-cn/library/y11056e9 (V = vs.100). aspx
There are other related information. Mark it and forget it later:
Http://msdn.microsoft.com/zh-cn/library/0c899ak8.aspx
Http://msdn.microsoft.com/zh-cn/library/dwhawy9k (V = vs.80). aspx
String [] formats = {"C3", "D4", "E1", "E2", "f1", "g", "N1 ",
"P0", "X4", "0000.0000 "};
Byte number = 240;
Foreach (string format in formats)
{
Console. writeline ("'{0}' format specifier: {1}", format, number. tostring (Format ));
}
Console output:
// 'c3' format specifier: $240.000
// 'd4 'format specifier: 0240
// 'e1 'format specifier: 2.4e + 002
// 'E2' format specifier: 2.40e + 002
// 'f1' format specifier: 240.0
// 'G' format specifier: 240
// 'n1 'format specifier: 240.0
// 'p0 'format specifier: 24,000%
// 'x4 'format specifier: 00f0
// '2017. 0000 'format specifier: 0240.0000