千位逗号分隔符转换处理

import java.text.NumberFormat; import java.util.Locale; public class test { public static void main(String args[]) { int amount = 2133333; String amount2 ; NumberFormat usFormat = NumberFormat.getIntegerInstance(Locale.US); amount2 = usFormat.format(amount); System.out.println(amount2); } }

结果是2,133,333

你可能感兴趣的:(String,Class,import)