Fixes: currency values (output, input, fee)

This commit is contained in:
Gustavo Cortez 2014-05-30 11:33:48 -03:00
parent 36b183f26d
commit 3604ff8651
2 changed files with 7 additions and 3 deletions

View File

@ -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') {

View File

@ -142,10 +142,10 @@
<div class="panel panel-default transaction-vin-vout">
<div class="panel-body">
<div class="pull-right btc-value">
<spam>{{$root.currency.getConvertion(vout.value) || vout.value + ' BTC'}}
<span>{{$root.currency.getConvertion(vout.value) || vout.value + ' BTC'}}
<span class="text-success" data-ng-show="!vout.spentTxId" tooltip="Output is unspent" tooltip-placement="left">(U)</span>
<a class="glyphicon glyphicon-chevron-right" data-ng-show="vout.spentTxId" href="/tx/{{vout.spentTxId}}/</{{vout.spentIndex}}" title="Spent at: {{vout.spentTxId}},{{vout.spentIndex}}"></a>&nbsp;&nbsp;
</spam>
</span>
</div>
<div class="ellipsis">
<a href="/address/{{address}}" data-ng-repeat="address in vout.scriptPubKey.addresses">{{address}}</a>