fibercrypto / fibercryptowallet

Multi-coin cryptocurrency wallet
GNU General Public License v3.0
27 stars 15 forks source link

FormatCoins problem with representations of numbers less than zero #337

Closed AntiD2ta closed 4 years ago

AntiD2ta commented 4 years ago

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.