import java.text.DecimalFormat;
public class FileTest {
public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("#,##0.00");
System.out.println(df.format(12345.626));
System.out.println(df.format(12345.6));
}
}
结果为:
12,345.63
12,345.60
时间: 2024-10-21 05:36:53