mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-15 18:28:47 +00:00
line total displayed
This commit is contained in:
parent
17e9f6575e
commit
00de30d884
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user