私がグーグルで見つけたものはすべて、次のいずれかが2倍を小数点以下2桁に切り捨てると言っています。
double roundToFourDecimals(double d)
{
DecimalFormat twoDForm = new DecimalFormat("#.##");
double myD = Double.valueOf(twoDForm.format(d));
return myD;
}
double nextLon = (double)Math.round(bnextLon * 100.0) / 100.0;
しかし、どちらも私にはうまくいきません。double の値は で3.3743984E7
あり、結果は同じです。どうしたの?