line total displayed

This commit is contained in:
Clayton Wilson 2020-11-05 00:48:41 -05:00
parent 17e9f6575e
commit 00de30d884

View File

@ -324,7 +324,7 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver {
totalPrice -= (Double.parseDouble(pPrices.get(position)) *
Double.parseDouble(pQuantity.get(position)));
tvTotalPrice.setText(String.format("$%.2f", totalPrice));
tvTotalPrice.setText(String.format("$%.2fllll", totalPrice));
pNames.remove(position);
pStores.remove(position);
@ -347,7 +347,11 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver {
if(!pNames.isEmpty()) {
name.setText(pNames.get(position));
store.setText(pStores.get(position));
price.setText("$" + pPrices.get(position));
if (Double.parseDouble(pPrices.get(position)) * Double.parseDouble(pQuantity.get(position)) < 0) {
price.setText(String.format("$%s", pPrices.get(position)));
} else {
price.setText(String.format("$%s ($%.2f)", pPrices.get(position), Double.parseDouble(pPrices.get(position)) * Double.parseDouble(pQuantity.get(position))));
}
if(pQuantity.get(position).equals("-1")) {
quantity.setVisibility(View.GONE);