project-serum / swap

Swap on the Serum Order Book
Apache License 2.0
78 stars 89 forks source link

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

Closed secretshardul closed 3 years ago

secretshardul commented 3 years ago

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.

image

armaniferrante commented 3 years ago

Moving this to the appropriate repo, here https://github.com/project-serum/swap-ui/issues/24.