mande-labs / trust-drops

Reputation based token drops with a unique reward distribution system incentivising value collaboration
https://app.mande.network
0 stars 3 forks source link

Token truncation fix #5

Closed Hekku2 closed 3 months ago

Hekku2 commented 3 months ago

Issue https://github.com/mande-labs/mande-chain/issues/45

This Pull Request changes the handling of number formatting in Dashboard.jsx, because there were a couple of cases where the number wouldn't show enough details for user to be able to destake correct amount of tokens.

Functional changes:

Input Previous Output New Output
2.00 2.00 2.00
2 2.00 2.00
2.1 2.10 2.00
1.99 1.99 1.99
1.99999 2.00 1.99
1.9999900000 2.00 1.99

Other important thing (also mentioned in comment as it's not immediately obvious), toFixed is not used to pad the length because of the way javascript handles floating point numbers.

vercel[bot] commented 3 months ago

@Hekku2 is attempting to deploy a commit to the Pratik's projects Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
trust-drops ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2024 2:21am
prtk418 commented 3 months ago

Thanks for the contribution @Hekku2

Hekku2 commented 3 months ago

No problem! And kudos for the project, looking good!