Skip to content

Commit

Permalink
fixed regex
Browse files Browse the repository at this point in the history
  • Loading branch information
kunzhi-yu committed Dec 20, 2022
1 parent 955bc25 commit 805c1f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/View/GroupSummaryView.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public void actionPerformed(ActionEvent evt) {
AddPurchaseView addPurchaseView = new AddPurchaseView(
this.groupUserNames);

if ((addPurchaseView.getItemPrice().matches("[0-9]+")) && (addPurchaseView.getSelectedMembers().size() > 0)) {
if ((addPurchaseView.getItemPrice().matches("\\d*\\.?\\d*")) && (addPurchaseView.getSelectedMembers().size() > 0)) {
float item_price = Float.parseFloat(addPurchaseView.getItemPrice());
UpdatedLists updatedList = controllerAddPurchase.controlAddPurchaseUseCase(itemID,
addPurchaseView.getSelectedMembers(), this.username, item_price, this.groupID);
Expand Down

0 comments on commit 805c1f8

Please sign in to comment.