java截取小数点后两位

String a = "123.3445776";
int i = a.indexOf(".");
System.out.println(a.substring(0, i+3));
System.out.println(a.substring(i+3, a.length()));
posted @ 2019-10-25 10:54  寒冰射手(电脑)  阅读(3493)  评论(0编辑  收藏  举报