Skip to content

Commit

Permalink
Update message
Browse files Browse the repository at this point in the history
  • Loading branch information
kngys committed Nov 6, 2024
1 parent a472d23 commit 41559d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public class Messages {
public static final String MESSAGE_TRANSACTIONS_LISTED_OVERVIEW = "Listed %1$d transaction(s) of %2$s";
public static final String MESSAGE_DUPLICATE_FIELDS =
"Multiple values specified for the following single-valued field(s): ";
public static final String MESSAGE_INVALID_AMOUNT = "Invalid amount!\n"
+ "Amount should be a number up to 2 decimals places and should not contain any commas.";
public static final String MESSAGE_INVALID_AMOUNT = "Incorrect amount format or invalid amount!\n"
+ "Amount should be a number of up to 2 decimal places containing only digits (0-9) and 1 decimal point. "
+ "There should be at least 1 digit before the decimal point.";
public static final String MESSAGE_INVALID_DATE_FORMAT = "Incorrect date format or invalid date!\n"
+ "Date format: YYYY-MM-DD";
public static final String MESSAGE_INVALID_MONTH_FORMAT = "Incorrect month format or invalid month!\n"
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public static Double parseAmount(String amountStr) throws ParseException {
try {
amount = Double.parseDouble(trimmedAmount);
} catch (NumberFormatException e) {
logger.fine("ParseException caused by invalid amount.");
logger.fine("ParseException caused by invalid amount or incorrect amount format.");
throw new ParseException(Messages.MESSAGE_INVALID_AMOUNT);
}
return amount;
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/seedu/address/model/person/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ public class Transaction {
public static final String MESSAGE_CONSTRAINTS =
"""
Amount should have at most 2 decimal places.
It should contain only digits(0-9) and one optional decimal point(.)
with no other symbols. There should be at least 1 digit before
the decimal point.
It should contain only digits (0-9) and one optional decimal point (.) with no other symbols.
There should be at least 1 digit before the decimal point.
""";
public static final String VALIDATION_REGEX = "^-?\\d+(,\\d{3})*(\\.\\d{1,2})?$";
private final String description;
Expand Down

0 comments on commit 41559d7

Please sign in to comment.