diff options
author | Dan Finlay <dan@danfinlay.com> | 2018-04-04 04:52:01 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2018-04-04 04:58:26 +0800 |
commit | 74049c19fce8ee77b1fa9933e26ac3569e3513f9 (patch) | |
tree | 324a93b0ce8418d047715e9d2c467e06c5410bba /ui | |
parent | 3e4b11e0d701441720bec665167984240a2aca56 (diff) | |
download | tangerine-wallet-browser-74049c19fce8ee77b1fa9933e26ac3569e3513f9.tar tangerine-wallet-browser-74049c19fce8ee77b1fa9933e26ac3569e3513f9.tar.gz tangerine-wallet-browser-74049c19fce8ee77b1fa9933e26ac3569e3513f9.tar.bz2 tangerine-wallet-browser-74049c19fce8ee77b1fa9933e26ac3569e3513f9.tar.lz tangerine-wallet-browser-74049c19fce8ee77b1fa9933e26ac3569e3513f9.tar.xz tangerine-wallet-browser-74049c19fce8ee77b1fa9933e26ac3569e3513f9.tar.zst tangerine-wallet-browser-74049c19fce8ee77b1fa9933e26ac3569e3513f9.zip |
Internationalize currency
Fixes #3580
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/balance-component.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ui/app/components/balance-component.js b/ui/app/components/balance-component.js index d591ab455..f6ca6dd26 100644 --- a/ui/app/components/balance-component.js +++ b/ui/app/components/balance-component.js @@ -4,6 +4,7 @@ const h = require('react-hyperscript') const inherits = require('util').inherits const TokenBalance = require('./token-balance') const Identicon = require('./identicon') +const currencyFormatter = require('currency-formatter') const { formatBalance, generateBalanceObject } = require('../util') @@ -97,9 +98,13 @@ BalanceComponent.prototype.renderFiatAmount = function (fiatDisplayNumber, fiatS const shouldNotRenderFiat = fiatDisplayNumber === 'N/A' || Number(fiatDisplayNumber) === 0 if (shouldNotRenderFiat) return null + const display = currencyFormatter.format(Number(fiatDisplayNumber), { + code: fiatSuffix.toUpperCase() + }) + return h('div.fiat-amount', { style: {}, - }, `${fiatPrefix}${fiatDisplayNumber} ${fiatSuffix}`) + }, display) } BalanceComponent.prototype.getTokenBalance = function (formattedBalance, shorten) { |