work040.java

package test02;

import java.text.DecimalFormat;

public class work040
{

	public static void main(String[] args)
	{
		DecimalFormat myFormat = new DecimalFormat();
		myFormat.setGroupingSize(2);
		String outString = myFormat.format(123456.789);
		System.out.println("将数字以每两个数字分组" + outString );
		myFormat.setGroupingUsed(false);
		String outString2 = myFormat.format(123456.789);
		System.out.println("不允许数字分组 " + outString2);
		
	}

}