From 80c9d682b59628c88b03b8034149e2eaa8ffff2d Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Mon, 13 Aug 2018 11:23:15 +1200 Subject: [PATCH] Fix in formatted-amount of display of subcent fees in transactions details page. --- src/js/directives/formattedAmount.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/js/directives/formattedAmount.js b/src/js/directives/formattedAmount.js index 9f70b37ed..68bb50781 100644 --- a/src/js/directives/formattedAmount.js +++ b/src/js/directives/formattedAmount.js @@ -86,15 +86,24 @@ } function formatNumbers() { + console.log('formatNumbers() "' + $scope.value + '", "' + $scope.currency + '"'); + // Might get "< 0.01 USD" being passed in. // During watch, may be changed from having a separate currency value, // to both being in value. Don't want to use previous currency value. // Try to extract currency from value.. var currencySplit = $scope.value.split(" "); - if (currencySplit.length === 2 && !$scope.currency) { - $scope.currency = currencySplit[1]; + if (currencySplit.length >= 2 && !$scope.currency) { + $scope.currency = currencySplit[currencySplit.length - 1]; } $scope.currency = $scope.currency || ''; + // Redo this when we have proper formatting for low fees + if ($scope.value.indexOf("<") === 0) { + buildAmount($scope.value, '', ''); + $scope.currency = ''; + $scope.canShow = true; + return; + } var parsed = parseFloat($scope.value); var valueFormatted = '';