码迷,mamicode.com
首页 > 编程语言 > 详细

java 有千位分隔逗号的数字格式化输出 数字前补0输出

时间:2017-11-13 23:05:32      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:逗号   格式化输出   print   const   int   sys   ant   ons   iter   

System.out.printf("%,5d %,6.1f\n", 312342, 3155623.932);
输出:312,342 3,155,623.9

System.out.printf("%05d %06.1f\n", 32, 32.32);
输出:00032 0032.3

java 有千位分隔逗号的数字格式化输出 数字前补0输出

标签:逗号   格式化输出   print   const   int   sys   ant   ons   iter   

原文地址:http://www.cnblogs.com/hyvonF/p/7828334.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!