project-serum / swap-ui

React Component for Swapping on the Serum DEX
Apache License 2.0
113 stars 117 forks source link

Reduce precision for small amounts, confusion due to exponential notation #24

Closed armaniferrante closed 3 years ago

armaniferrante commented 3 years ago

Original issue here.

The current SRM to HOLD rate is 1 SRM = 42513513.513513513 HOLD.

When I pick HOLD -> SRM and set HOLD amount as 1, it shows that I will receive 2.337826453243471e SRM. This appears as 2.33 on the UI.