Hi i'v got two different activities sending a number to a third activity, where one of the numbers will be displayed and some calculations carried out on them, depending on what number came through

It was working fine when I had activity 1 going to activity 3, but now i have a second activity going to activity 3, I don't know what to do

What i'm trying to do is, if the number came from activity 1, id like to display that number do some calculations on it and display the answers, and if the number came form activity 2 do the same

Sorry if title makes no sense, haven't a clue what i'm talking about

`

```
`Intent sender = getIntent();
    `   
  if (sender != null)
    {
    int result = sender.getExtras().getInt("Result");
    answer.setText(result+"");

    a = Integer.parseInt (answer.getText().toString());
    total1 = (float) (a *0.0024); 
    sd.setText(String.format("%.1f" ,total1));

    b = Float.parseFloat (sd.getText().toString());
    total2 = (int)Math.ceil (b*8);
    cet.setText(Integer.toString(total2));

    }

    else
{
 int resultB = sender.getExtras().getInt("BResult");
     answer.setText(resultB+"");

     a = Integer.parseInt (answer.getText().toString());
     total1 = (float) (a *0.001); 
     sd.setText(String.format("%.1f" ,total1));

     b = Float.parseFloat (sd.getText().toString());
     total2 = (int)Math.ceil (b*8);
     cet.setText(Integer.toString(total2));

}
}

```