public class Test {
public static void main(String[] args) {
double d = 1671.0;
DecimalFormat df = new DecimalFormat("#.0");
System.out.println(df.format(d / 1000));
}
public static void main(String[] args) {
double d = 1671.0;
DecimalFormat df = new DecimalFormat("#.0");
System.out.println(df.format(d / 1000));
}
}
//输出结果为:1.7