Skip to content

Commit

Permalink
chore(MatchContributionDialog): handle edge case for valueInCents (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree authored Jul 4, 2024
1 parent ccc1f2a commit 4c67f73
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const suggestExpectedFundsQuery = gql`
* of decimals in the value: 123 would be rounded to -2 (=100), 123456 would be rounded to -5 (=100000).
*/
const getAmountRangeFilter = (valueInCents: number) => {
const precision = -Math.floor(Math.log10(valueInCents));
const precision = Math.min(1 - Math.floor(Math.log10(valueInCents)), -2);
return {
type: AmountFilterType.IS_BETWEEN,
gte: floor(valueInCents * 0.8, precision),
Expand Down

0 comments on commit 4c67f73

Please sign in to comment.