DeXter-on-Radix / website

Community built order book dex on Radix.
https://dexteronradix.com/
6 stars 14 forks source link

Fix precision issue #384

Closed dcts closed 3 weeks ago

dcts commented 3 weeks ago

This PR:

cloudflare-pages[bot] commented 3 weeks ago

Deploying dexter with  Cloudflare Pages  Cloudflare Pages

Latest commit: e2fadfe
Status: ✅  Deploy successful!
Preview URL: https://49bceb21.dexter-1we.pages.dev
Branch Preview URL: https://fix-precision-issue.dexter-1we.pages.dev

View logs

dcts commented 3 weeks ago

@EvgeniiaVak updated the frontend precision to be the same for both the label and the description. I am against setting the precision to be 3 as specified in the wallet app because we run into multiple issues:

  1. we don't control the wallet app and don't know how they compute the precision. Will they also show only 3 decimals on high value coins like FLOOP? What if they decide to update the app? It will be tedious and less maintainable. Better to have our own logic that is consistent (and I agree we should be showing values formatted the same on our end).
  2. I am against 3 decimals, because it can easily be confused as thousands delimitter.
  3. Our logic to show precision is currently hardcoded here but should be adapted to be more resiliant and dynamically computed, this is another bug (#371) and is not part of this PR.

Given the above I just changed the display to be 2 decimals for both frontend displays, hope that is fine for now to merge this PR.