Nothing's wrong. 3.3743984E7
is scientific notation. That is:
3.3743984E7 = 3.3743984 * 10^7 = 33743984
33,743,984.0 rounded to two decimal places is 33,743,984.0. If, perhaps you specified 33743984.05918
, it would be rounded to 33743984.06
, but both outputs would still say 3.3743984E7
. (The preceding comment has been deleted due to invalidity found by @Sam.)
I can verify that your rounding code works:
public class Main {
public static void main(String[] args) {
double bnextLon = 275914.18410;
double nextLon = (double) Math.round(bnextLon * 100.0) / 100.0;
System.out.println(bnextLon + " became " + nextLon);
}
}
275914.1841 became 275914.18
I believe you simply need to determine what value you want in, and what value you want out. The code is giving you exactly what you're specifying.