Skip to content

Commit

Permalink
DON-909: Allow tip amounts with only one decimal, e.g. 12.5 for £12.50
Browse files Browse the repository at this point in the history
When this field is set from code we may end up with just one decimal
here, which would be invalid previously.
  • Loading branch information
bdsl committed Oct 13, 2023
1 parent 35391a9 commit 18c88d1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1848,7 +1848,7 @@ export class DonationStartFormComponent implements AfterContentChecked, AfterCon
// We allow spaces at start and end of amount inputs because people can easily paste them in
// by mistake, and they don't do any harm. Maxlength in the HTML makes sure there can't be so much as
// to stop the number being visible.
Validators.pattern('^\\s*[£$]?[0-9]+?(\\.[0-9]{2})?\\s*$'),
Validators.pattern('^\\s*[£$]?[0-9]+?(\\.[0-9]{1,2})?\\s*$'),
getCurrencyMaxValidator(),
]);
}
Expand Down

0 comments on commit 18c88d1

Please sign in to comment.