本文链接: https://blog.csdn.net/lishuangquan1987/article/details/130414137
需求:将0输出为 000,99输出为 099
c#
Console.WriteLine(0.ToString("000"));
Console.WriteLine(99.ToString("000"));
go
fmt.Printf("%03d", 0)
fmt.Printf("%03d", 99)
运行效果:

本文链接: https://blog.csdn.net/lishuangquan1987/article/details/130414137
需求:将0输出为 000,99输出为 099
Console.WriteLine(0.ToString("000"));
Console.WriteLine(99.ToString("000"));
fmt.Printf("%03d", 0)
fmt.Printf("%03d", 99)
运行效果:

评论区