给数字补0

String.format("%04d", 2)
输出
0002

 

posted @ 2019-03-01 08:12  冬马党  阅读(97)  评论(0)    收藏  举报