Skip to content

Commit

Permalink
Format encoding of current dish price to 2dp.
Browse files Browse the repository at this point in the history
  • Loading branch information
NaychiMin committed Nov 12, 2023
1 parent e76fc31 commit 4aadb07
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/main/java/seedu/cafectrl/storage/Decoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ private static void decodeSalesData(String orderLine, ArrayList<OrderList> order
orderLists.get(day).addOrder(orderedDish);
} catch (Exception e) {
logger.log(Level.WARNING, "Line corrupted: " + e.getMessage(), e);
System.out.println(e.getMessage());
ui.showToUser(ErrorMessages.INVALID_SALES_DATA + orderLine);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/cafectrl/storage/Encoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public static ArrayList<String> encodeSales(Sales sales) {
orderString.append((day + 1) + DIVIDER);
orderString.append(order.getDishName() + DIVIDER);
orderString.append(order.getQuantity() + DIVIDER);
orderString.append(order.getOrderedDish().getPrice() + DIVIDER);
orderString.append(String.format("%.2f", order.getOrderedDish().getPrice()) + DIVIDER);
orderString.append(order.getIsComplete());
orderString.append(System.lineSeparator());
encodedList.add(String.valueOf(orderString));
Expand Down

0 comments on commit 4aadb07

Please sign in to comment.