Skip to content

Commit

Permalink
Add decimals when calculating preview price ratio (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
nichosystem authored Jan 13, 2023
1 parent 5dc0207 commit ecf2e1b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export const TransactionPreviewModal: React.FC<IProps> = ({ isOpen, onClose, sta
</PriceContainer>
<PriceMarker>
1 {state.inputToken} ={' '}
{(Number(ethers.utils.formatEther(state.quote.returnAmount)) / Number(state.inputValue)).toFixed(4)}{' '}
{(
Number(ethers.utils.formatUnits(state.quote.returnAmount, getTokenInfo(state.outputToken).decimals)) /
Number(state.inputValue)
).toFixed(4)}{' '}
{state.outputToken}
</PriceMarker>
<SwapDetails>
Expand Down

0 comments on commit ecf2e1b

Please sign in to comment.