1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-30 12:18:09 +00:00

dont round fiat rate when calculating total balance

This commit is contained in:
slowbackspace 2019-05-16 18:35:38 +02:00
parent 89fa7d3177
commit e54f2066ea

View File

@ -6,6 +6,7 @@ import { Icon, Tooltip, colors, icons as ICONS } from 'trezor-ui-components';
import { FormattedMessage, FormattedNumber } from 'react-intl';
import { FONT_SIZE, FONT_WEIGHT } from 'config/variables';
import type { Network, State as ReducersState } from 'flowtype';
import { toFiatCurrency } from 'utils/fiatConverter';
import l10nMessages from '../../../components/Balance/index.messages';
type Props = {
@ -129,13 +130,11 @@ class AccountBalance extends PureComponent<Props, State> {
render() {
const { network, localCurrency } = this.props;
const fiatRates = this.props.fiat.find(f => f.network === network.shortcut);
let accountBalance = '';
let fiatRateValue = '';
let fiat = '';
if (fiatRates) {
accountBalance = new BigNumber(this.props.balance);
fiatRateValue = new BigNumber(fiatRates.rates[localCurrency]).toFixed(2);
fiat = accountBalance.times(fiatRateValue).toFixed(2);
fiat = toFiatCurrency(this.props.balance, localCurrency, fiatRates);
}
const NoRatesTooltip = (