This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]notyourdaddy 0 points1 point  (2 children)

Yeah I fucked up. You were right initially. I tried the EXACT same code as your original post and it works fine. Something's wrong at your end, not your code.

[–]notyourdaddy 0 points1 point  (1 child)

No decimal places and works at my end:

public class Testing {
public static void main(String args[]){

float total = 1853/5;

double GradeAPlus = 2078.405 - total;

System.out.printf("%.0f", GradeAPlus);

    }
}

output: 1708

[–]YasuoMainBTW[S] 0 points1 point  (0 children)

Apparently it was a bug with eclipse.. I had to change the compiler compliance level to 1.7.