1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Rounding of vals < 0.01 in currency display consistent with master.

This commit is contained in:
Dan 2017-11-10 07:07:53 -03:30 committed by Chi Kei Chan
parent 5120cfdff3
commit 5a0126f17b
2 changed files with 3 additions and 2 deletions

View File

@ -68,13 +68,14 @@ CurrencyDisplay.prototype.render = function () {
const valueToRender = this.getValueToRender()
const convertedValue = conversionUtil(valueToRender, {
let convertedValue = conversionUtil(valueToRender, {
fromNumericBase: 'dec',
fromCurrency: primaryCurrency,
toCurrency: convertedCurrency,
numberOfDecimals: 2,
conversionRate,
})
convertedValue = Number(convertedValue).toFixed(2)
return h('div', {
className,

View File

@ -37,7 +37,7 @@ const BIG_NUMBER_GWEI_MULTIPLIER = new BigNumber('1000000000')
// Individual Setters
const convert = R.invoker(1, 'times')
const round = R.invoker(2, 'round')(R.__, BigNumber.ROUND_DOWN)
const round = R.invoker(2, 'round')(R.__, BigNumber.ROUND_HALF_DOWN)
const invertConversionRate = conversionRate => () => new BigNumber(1.0).div(conversionRate)
const decToBigNumberViaString = n => R.pipe(String, toBigNumber['dec'])