Я пытаюсь разделить десятичное число на целое число и точки в Android Studio
Button btSpilt;
EditText Input;
TextView wholenumber, points;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
wholenumber = (TextView) findViewById(R.id.wholenumber);
points = (TextView) findViewById(R.id.points);
Input = (EditText) findViewById(R.id.Input);
btSpilt = (Button) findViewById(R.id.btSpilt);
btSpilt = findViewById(R.id.btSpilt);
btSpilt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String s_input = Input.getText().toString();
double input = Double.parseDouble(s_input);
int a = Integer.parseInt(s_input);
double aa = a;
double b = (10 * input - 10 * input)/10;
String str_a = Integer.toString((int) aa);
String str_b = Integer.toString((int) b);
wholenumber.setText(str_a);
points.setText(str_b);
}
});
это работает хорошо при вводе целого числа, но при десятичном вводе все приложение падает