1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00
This commit is contained in:
Kevin Serrano 2016-08-16 14:51:55 -07:00
parent 5afaebe602
commit 121af0c4b9

View File

@ -46,15 +46,16 @@ EthBalanceComponent.prototype.render = function () {
EthBalanceComponent.prototype.renderBalance = function (value, state) { EthBalanceComponent.prototype.renderBalance = function (value, state) {
if (value === 'None') return value if (value === 'None') return value
var balanceObj = generateBalanceObject(value, state.shorten ? 1 : 3) var balanceObj = generateBalanceObject(value, state.shorten ? 1 : 3)
var balance var balance, fiatNumber
var splitBalance = value.split(' ') var splitBalance = value.split(' ')
var ethNumber = splitBalance[0] var ethNumber = splitBalance[0]
var ethSuffix = splitBalance[1] var ethSuffix = splitBalance[1]
if (state.conversionRate !== 'N/A') { if (state.conversionRate !== 'N/A') {
var fiatNumber = (Number(splitBalance[0]) * state.conversionRate).toFixed(2) fiatNumber = (Number(splitBalance[0]) * state.conversionRate).toFixed(2)
} else { } else {
var fiatNumber = 'N/A' fiatNumber = 'N/A'
} }
var fiatSuffix = state.currentFiat var fiatSuffix = state.currentFiat
@ -100,7 +101,7 @@ EthBalanceComponent.prototype.renderBalance = function (value, state) {
position: 'bottom', position: 'bottom',
title: `${fiatNumber} ${fiatSuffix}`, title: `${fiatNumber} ${fiatSuffix}`,
}, [ }, [
fiatDisplay (fiatNumber, fiatSuffix) fiatDisplay(fiatNumber, fiatSuffix),
]), ]),
]) ])
) )