-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurrencyconverter.java
30 lines (21 loc) · 980 Bytes
/
currencyconverter.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[200~package com.example.currencyconverter;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
public void Convertclick(View view){
EditText amountedittext = (EditText) findViewById(R.id.amountedittext);
Double dollarAmountdouble = Double.parseDouble(amountedittext.getText().toString());
Double rupeeamount = dollarAmountdouble * 71.94;
Toast.makeText(MainActivity.this, "Rs." + String.format("%.2f", rupeeamount), Toast.LENGTH_LONG).show();
Log.i("Test", "Button clicked");
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}