I am trying to round the following value 1.48824E9
, that is returning inside the date.getTime() method.
This is what I've tried but It's not working:
private double x;
private double y;
DecimalFormat df;
private double z;
private String g;
double a;
public GraphPoints(Date x, double y) {
df = new DecimalFormat("#.#");
df.setRoundingMode(RoundingMode.CEILING);
a = x.getTime();
g = df.format(a);
z = Double.parseDouble(g);
System.out.println("THIS IS THE ROUNDED VALUE: " + z);
this.x = z;
this.x = z;
this.y = y;
}
I'm trying to round it to one decimal place. Could someone help me please?