fibercrypto / fibercryptowallet

Multi-coin cryptocurrency wallet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FormatCoins problem with representations of numbers less than zero

AntiD2ta opened this issue · comments

Describe the bug
Currently util.FormatCoins function does not allow representations of numbers that are less than the respective accuracy for that number.

Steps to Reproduce
Steps to reproduce the behavior:

  1. Make a transaction of an amount less than zero
  2. Run the app
  3. Go to a page where you can see the transaction or look for Outputs page
  4. See the amount, you should see 0 instead of 0.XXX

Expected behavior
The number should be represented properly, as 0.XXX with all its decimal digits

Possible implementation
Because several accuracy values ​​are powers of 10, we can cleanly divide the number by its accuracy when it is less than the accuracy.