首页 > 学院 > 开发设计 > 正文

String.format常用方法

2019-11-06 06:53:14
字体:
来源:转载
供稿:网友
System.out.PRintln(String.format("不够3位前面补0:%03d%n", 7));//007System.out.println(String.format("整数按3位分组:%,d%n", 9989997));//9,989,997System.out.println(String.format("空格50,结果保留5位小数:%50.5f元%n", 49.8));//49.80000
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表