格式化数字的方法

来源:互联网 发布:python实战 编辑:程序博客网 时间:2024/06/05 04:08

数字输出为001,002,003开始


// 格式化字符串:

String.format(Local.CHINA,"编号:%03d",position);
或者:
new DecimalFormat("000").format(position + 1)
0 0