Skip to content

Commit

Permalink
Merge pull request #6499 from Expensify/dsilva_changeIOUAmountToTwoDe…
Browse files Browse the repository at this point in the history
…cimals

changed logic to use 2 decimals instead of 3
  • Loading branch information
Amal Nazeem authored Nov 29, 2021
2 parents d471d34 + 74aab68 commit de6aca9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/iou/steps/IOUAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ class IOUAmountPage extends React.Component {
* @returns {Boolean}
*/
validateAmount(amount) {
const decimalNumberRegex = new RegExp(/^\d+(,\d+)*(\.\d{0,3})?$/, 'i');
return amount === '' || (decimalNumberRegex.test(amount) && (parseFloat((amount * 100).toFixed(3)).toString().length <= CONST.IOU.AMOUNT_MAX_LENGTH));
const decimalNumberRegex = new RegExp(/^\d+(,\d+)*(\.\d{0,2})?$/, 'i');
return amount === '' || (decimalNumberRegex.test(amount) && (parseFloat((amount * 100).toFixed(2)).toString().length <= CONST.IOU.AMOUNT_MAX_LENGTH));
}

/**
Expand Down

0 comments on commit de6aca9

Please sign in to comment.