int a = 2000;String str = NumberFormat.getIntegerInstance(Locale.getDefault()).format(a); //转为千分符字符串System.out.println(str); try { int b = NumberFormat.getIntegerInstance(Locale.getDefault()).parse(str).intValue(); //转为数字 System.out.println("" + b);} catch (ParseException e) { e.printStackTrace();}
时间: 2024-10-12 21:19:08