Skip to content

Commit

Permalink
fix number rate order
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh committed Jul 21, 2023
1 parent 3d5bfa5 commit e841860
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/swapv2/LimitOrder/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export const formatRateLimitOrder = (order: LimitOrder, invert: boolean) => {
} catch (error) {
console.log(error)
}
return formatNumberWithPrecisionRange(parseFloat(rateValue.toFixed(16)), 0, 8)
const float = parseFloat(rateValue.toFixed(16))
return formatNumberWithPrecisionRange(float, 0, float < 1e-8 ? 16 : 8)
}

export const calcPercentFilledOrder = (value: string, total: string, decimals: number) => {
Expand Down

0 comments on commit e841860

Please sign in to comment.