こんにちはお友達10進数の後に2つの値を取得したいのですが、私は10進数の後に0を返します。これは私のコードです。小数点以下2桁まで取得できませんが、ゼロになる
if (!ed.getText().toString().equals("")) {
if (rb1.isChecked()) {
int input = Integer.valueOf(ed.getText().toString());
double out = input/24;
out = (double)Math.round(out * 100)/100;
Intent m = new Intent(Page.this,MActivity.class);
m.putDoubleExtra("res", out);
startActivity(m);
私はまた、これらのサイトを参照さ:Android : How to get just two digit after the point in decimal value ? dont want to trunc the value
Java : how do I get the part after the decimal point?
をし、私はまた、以下のコードを試みたが、それは、小数点の後に0を得ます。
コーディングを新しくしてください。前もって感謝します。
dの値は? –