I asked many people after posting and they all suggested writing logic for processing. But the logic of this problem is very simple. If you really deal with it yourself, I am a little lazy. I always feel that the official should provide APIs to implement this function, and live up to expectations. I found it myself. It's really too simple. The solution is as follows:
The code copy is as follows:
DecimalFormat formatter = new DecimalFormat();
//Default integer parts are three in group
String str = formatter.format(value);
//You can also set one group per n by yourself
int m=n;
df.setGroupingSize(m);
over!