Java
亦殇惘兮
这个作者很懒,什么都没留下…
展开
-
自动转换金额
public static void main(String[] args) {System.out.println(getMoney(-1234561, 2));}public static String getMoney(int number,int b){StringBuffer b1 = new StringBuffer(b+"");if (b1.length()!原创 2017-11-21 23:36:14 · 139 阅读 · 0 评论 -
将毫秒转换为时间(HH:ss:mm)
public static void main(String[] args) {//毫秒数int ms = 3661;//时int hour = ms / 3600 //分int minute = (ms - hour * 3600) / 60;//秒ms = ms - hour * 3600 - minute * 60;String time = hour +原创 2017-11-21 23:36:33 · 2132 阅读 · 0 评论 -
输出文件到项目
String path = request.getSession().getServletContext().getRealPath("/statics/log/out.txt"); File out = new File(path);System.out.println(1); System.out.println(out.getAbsolutePath());原创 2017-11-21 23:37:07 · 165 阅读 · 0 评论