Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #1501 wallet: display right fee amount #1509

Merged
merged 1 commit into from Jul 27, 2017
Merged

Conversation

janherich
Copy link
Contributor

fixes #1501

Summary:

Previously, to be able to format fractional number to fixed amount of decimal places, string returned from web3.fromWei call was parsed into native js float type with parseFloat function. Unfortunately for some amounts (not immediately obvious during developer testing), this is not enough, as native js float has problems with precision, so slightly different sum was displayed between fee/amount edits.
This PR solves it by parsing web3.fromWei result directly into BigNumber type (this type should be returned from web3.fromWei call anyway, but it depends on call arguments) and calling toFixed(n) method in it.

Steps to test:

  • Open Status
  • Open 1-1 Chat
  • Start typing /send command and select amount 10
  • Push the fee slider to the right (max), remember the fee shown
  • Edit the amount to 1
  • Edit the amount back to 10
  • Compare the fee with the fee shown for amount 10 for the first time (before amount edit), they should be the same

status: ready

@rasom rasom merged commit d90dab8 into develop Jul 27, 2017
@rasom rasom deleted the bug/fee-amount-#1501 branch July 27, 2017 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different fee amount of the same precision is shown for same sum after editing the sum [develop]
2 participants