Skip to content

Commit

Permalink
[QA] Amount displayed in "More routes available" message should have …
Browse files Browse the repository at this point in the history
…more decimal places (#2762)

* [QA] Amount displayed in More routes available message should have more decimal places

* [QA] Amount displayed in More routes available message should have more decimal places

* comment
  • Loading branch information
danielisaacgeslin authored Oct 7, 2024
1 parent 8ae2ebc commit f6da020
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions wormhole-connect/src/hooks/useAmountValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ export const useAmountValidation = (props: Props): HookReturn => {
// All quotes fail.
if (allRoutesFailed) {
if (minAmount) {
const formattedAmount = sdkAmount.whole(minAmount).toLocaleString('en', {
maximumFractionDigits: 4,
});
const formattedAmount = sdkAmount.display(minAmount);
return {
error: `Amount too small (min ~${formattedAmount} ${props.tokenSymbol})`,
};
Expand All @@ -97,9 +95,7 @@ export const useAmountValidation = (props: Props): HookReturn => {

// MinQuote warnings information
if (minAmount) {
const formattedAmount = sdkAmount.whole(minAmount).toLocaleString('en', {
maximumFractionDigits: 4,
});
const formattedAmount = sdkAmount.display(minAmount);
return {
warning: `More routes available for amounts exceeding ${formattedAmount} ${props.tokenSymbol}`,
};
Expand Down

0 comments on commit f6da020

Please sign in to comment.