Skip to content

Commit

Permalink
Release 2.3.3 (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
bayological authored Dec 17, 2024
1 parent a391ba4 commit 37676a5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mento-protocol/mento-web",
"version": "2.3.2",
"version": "2.3.3",
"description": "A simple DApp for Celo Mento exchanges",
"keywords": [
"Celo",
Expand Down
2 changes: 1 addition & 1 deletion src/features/swap/SwapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function SubmitButton() {
const showLongError = typeof error === 'string' && error?.length > 50

return (
<div className="flex flex-col w-full items-center justify-center">
<div className="flex flex-col items-center justify-center w-full">
{showLongError ? (
<div className="bg-[#E14F4F] rounded-md text-white p-4 mb-6">{error}</div>
) : null}
Expand Down
2 changes: 1 addition & 1 deletion src/features/swap/useSwapQuote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function useSwapQuote(
quoteWei = (await mento.getAmountIn(fromTokenAddr, toTokenAddr, amountWeiBN)).toString()
}

const quote = fromWei(quoteWei, quoteDecimals).toString()
const quote = fromWei(quoteWei, quoteDecimals)
const rateIn = calcExchangeRate(amountWei, amountDecimals, quoteWei, quoteDecimals)
const rate = isSwapIn ? rateIn : invertExchangeRate(rateIn)

Expand Down
6 changes: 3 additions & 3 deletions src/utils/amount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export type NumberT = BigNumber.Value
export function fromWei(
value: NumberT | null | undefined,
decimals = STANDARD_TOKEN_DECIMALS
): number {
if (!value) return 0
): string {
if (!value) return '0'
const valueString = value.toString().trim()
const flooredValue = new BigNumber(valueString).toFixed(0, BigNumber.ROUND_FLOOR)
return parseFloat(formatUnits(flooredValue, decimals))
return formatUnits(flooredValue, decimals)
}

// Similar to fromWei above but rounds to set number of decimals
Expand Down

0 comments on commit 37676a5

Please sign in to comment.