From 3604ff86517407ed7133496258d96f971f7f864b Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Fri, 30 May 2014 11:33:48 -0300 Subject: [PATCH] Fixes: currency values (output, input, fee) --- public/src/js/controllers/currency.js | 6 +++++- public/views/transaction/tx.html | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/public/src/js/controllers/currency.js b/public/src/js/controllers/currency.js index f7814e8..3542523 100644 --- a/public/src/js/controllers/currency.js +++ b/public/src/js/controllers/currency.js @@ -10,7 +10,11 @@ angular.module('insight.currency').controller('CurrencyController', }; $rootScope.currency.getConvertion = function(value) { - if (typeof value !== 'undefined' && value !== null) { + value = value * 1; // Convert to number + + if (!isNaN(value) && typeof value !== 'undefined' && value !== null) { + if (value === 0.00000000) return '0 ' + this.symbol; // fix value to show + var response; if (this.symbol === 'USD') { diff --git a/public/views/transaction/tx.html b/public/views/transaction/tx.html index d622619..9955374 100644 --- a/public/views/transaction/tx.html +++ b/public/views/transaction/tx.html @@ -142,10 +142,10 @@
- {{$root.currency.getConvertion(vout.value) || vout.value + ' BTC'}} + {{$root.currency.getConvertion(vout.value) || vout.value + ' BTC'}} (U)    - +