Simplified multiplier calculation

This commit is contained in:
Nicolás Sánchez 2024-12-27 10:36:23 -03:00
parent c7ba216b34
commit 9cd48dfede
1 changed files with 1 additions and 3 deletions

View File

@ -82,7 +82,6 @@ public class WorkerCardAdapter{
price.setText(String.format(Locale.ROOT, "%.8f", worker.getPrice()));
//TODO: If short and old_long and next_so_price<switch_price, set color to green
nextSoPrice.setText(String.format(Locale.ROOT, "%.8f", worker.getNextSoPrice()));
if (worker.isShort() &&
worker.getOldLongDictionary()!=null &&
@ -147,8 +146,7 @@ public class WorkerCardAdapter{
} else if (worker.isAuto()) {
String stringToDisplay = "AUTO";
if (worker.getPrice()!=0) {
double percentageToSwitch = (worker.getOldLongDictionary().getTpPrice()-worker.getPrice())*100/worker.getPrice();
int multiplier = (int) (percentageToSwitch/100+1);
int multiplier = (int) (worker.getOldLongDictionary().getTpPrice() / worker.getPrice());
if (multiplier>1) {
stringToDisplay = stringToDisplay + " x" + multiplier;
}