This repository was archived by the owner on May 24, 2022. It is now read-only.
fix: Fixes #244. Concatenate balances to 2 decimal places on account overview page without rounding#291
Merged
amaury1093 merged 5 commits intomasterfrom Dec 19, 2018
Merged
Conversation
Contributor
Author
|
Note that another approach could be to use BigNumber.js rounding http://mikemcl.github.io/bignumber.js/#constructor-properties |
amaury1093
reviewed
Dec 15, 2018
| {balance ? ( | ||
| <span>{balance.toFixed(decimals)} </span> | ||
| <span> | ||
| {concatBalanceByDecimalPlaces(balance.toString(), decimals)}{' '} |
Collaborator
There was a problem hiding this comment.
I think .toFixed(decimals, 1) does exactly this, 1 == ROUND_DOWN
Edit: or .dp(decimals, 1)
amaury1093
approved these changes
Dec 19, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With these changes, given an account with 0.999432 ETH and 1233.8945 TIB.
Previously the account summary page would show:
Ether: 1.00
THIBCoin: 1233.89
Now it shows:
Ether: 0.99
THIBCoin: 1233.89
Previously the Send Ether page would show: 0.999432
Now it shows: 0.999432
Previously the Send THIBCoin page would show: 1233.894500
Now it shows: 1233.8945