int currentSitMoney = 0;
int currentSitPercent = 0;
void buyValue() {
setState(() {
int boughtValue = valueNotifier.value;
money = money - money;
int newValue = valueNotifier.value;
currentSitPercent = (newValue - boughtValue) ~/ boughtValue * 100;
currentSitMoney = (money * currentSitPercent) + money;
});
}
I have a parameter called random that gets random numbers between 1 to 999 included, I want to press buy and it will record the the value that was when I pressed and than calculated the profit or loss that you make and than when you sell it will calculate how much money you should be returned. now I dont know even if I did it correctly but please tell me if its correct how do I put the output in a text widget the currentSitMoney and currentSitPercent...
