question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

parseFloat makes quantities / referenced amounts confusing to end users and integrators

See original GitHub issue

Describe the bug The use of parseFloat in the explorer is confusing to integrators and end users because it gives an incorrect perception of the amount being transferred, and the balance of holdings.

Reference # 1, e.g. balance of USDA is not $330,891,881.00:

image

Link to explorer: https://explorer.stacks.co/address/SPWVN0HJ5RJJWXPAP5JFNZ9Q0V68TVSS1WSG45X6?chain=mainnet

Reference # 2, e.g. this is not a transfer of $11B USD

image

Link to explorer: https://explorer.stacks.co/txid/0x8e8773bf0693a9ba7543eb2bef58634e91d8fc49cc0c2a5132c391843cf7acc6?chain=mainnet

Expected behavior Explorer should take decimals into account for token (get-decimals).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
fbwoolfcommented, Jan 10, 2022

Hoping to release this to production today! 🙌

1reaction
wbnnscommented, Dec 28, 2021

@fbwoolf Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tokens are displayed with decimals · Issue #402
wbnns mentioned this issue on Dec 17, 2021. parseFloat makes quantities / referenced amounts confusing to end users and integrators #604.
Read more >
parseFloat() - JavaScript - MDN Web Docs
The parseFloat() function parses a string argument and returns a floating point number.
Read more >
The difference between number (), parseint (), and ...
A: Number ()If it is a Boolean value, the true and false values are converted to 1 and 0, respectively.If it is a...
Read more >
Javascript parse float is ignoring the decimals after my ...
This is assuming that the amount from the existing database is 3,000.78. The results are: 3000.78 without the initial comma (,) .
Read more >
parseFloat vs Number: What's the Difference? - Cam McHenry
Picking a function to use for parsing numbers can be a confusing question to answer, ... parseFloat: Stops When Input Stops Making Sense....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found