Skip to content

Commit

Permalink
Merge pull request #5243 from akshayasalvi/iou-amt-maxlength
Browse files Browse the repository at this point in the history
[Deploy Blocker] Changed max length to 11 for alignment issues
  • Loading branch information
francoisl authored Sep 15, 2021
2 parents 86bec1b + 1c4e396 commit 09dd0bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ const CONST = {
PAYPAL_ME: 'PayPal.me',
VENMO: 'Venmo',
},
AMOUNT_MAX_LENGTH: 14,
AMOUNT_MAX_LENGTH: 10,
},

GROWL: {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/iou/steps/IOUAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class IOUAmountPage extends React.Component {
*/
validateAmount(amount) {
const decimalNumberRegex = new RegExp(/^\d+(,\d+)*(\.\d{0,3})?$/, 'i');
return amount === '' || (decimalNumberRegex.test(amount) && amount.length <= CONST.IOU.AMOUNT_MAX_LENGTH);
return amount === '' || (decimalNumberRegex.test(amount) && ((parseFloat(amount) * 100).toString().length <= CONST.IOU.AMOUNT_MAX_LENGTH));
}

/**
Expand Down

0 comments on commit 09dd0bf

Please sign in to comment.