Created
July 14, 2020 17:05
-
-
Save fatihhcan/e9614f8e5b98c7462cbc3b2c3020eee2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun Equals(view: View) { | |
var newCount=dataView.text.toString() | |
var result:Double?=null | |
//when işlemi ile operator butonların işlevlerini sağladık | |
when(operator){ | |
"/"->{ | |
result=oldCount.toDouble()/newCount.toDouble() | |
} | |
"*"->{ | |
result=oldCount.toDouble()*newCount.toDouble() | |
} | |
"-"->{ | |
result=oldCount.toDouble()-newCount.toDouble() | |
} | |
"+"->{ | |
result=oldCount.toDouble()+newCount.toDouble() | |
} | |
} | |
dataView.setText(result.toString()) | |
newOperator=true | |
} | |
fun Ac(view: View) { | |
dataView.setText("0") | |
newOperator=true | |
} | |
fun Per(view: View) { | |
//sayi veri tipini double yaptık , edit textin ilk stringe sonra double cevirdik ve 100 e bolduk | |
var count:Double=dataView.text.toString().toDouble()/100 | |
dataView.setText(count.toString()) | |
newOperator=true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment