diff --git a/src/js/directives/amount.js b/src/js/directives/amount.js deleted file mode 100644 index bf519c0d0..000000000 --- a/src/js/directives/amount.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -/** - * @desc amount directive that can be used to display formatted financial values - * @example - */ -angular.module('bitcoincom.directives') - .directive('amount', [ - '$timeout', - function($timeout) { - return { - restrict: 'E', - scope: { - value: '=', - currency: '=' - }, - templateUrl: 'views/includes/amount.html', - controller: ['$scope', function($scope) { - var decimalPlaces = { - '0': ['BIF', 'CLP', 'DJF', 'GNF', 'ILS', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'], - '3': ['BHD', 'IQD', 'JOD', 'KWD', 'OMR', 'TND'], - '8': ['BCH', 'BTC'] - }; - - var numberWithCommas = function(x) { - return parseFloat(x).toLocaleString(); - }; - - var buildAmount = function(start, middle, end) { - $scope.start = start; - $scope.middle = middle; - $scope.end = end; - }; - - var getDecimalPlaces = function(currency) { - if (decimalPlaces['0'].indexOf($scope.currency.toUpperCase()) > -1) return '0'; - if (decimalPlaces['3'].indexOf($scope.currency.toUpperCase()) > -1) return '3'; - if (decimalPlaces['8'].indexOf($scope.currency.toUpperCase()) > -1) return '8'; - return '2'; - }; - - switch (getDecimalPlaces($scope.currency)) { - case '0': - var valueFormatted = numberWithCommas(Math.round(parseFloat($scope.value))); - buildAmount(valueFormatted, '', ''); - break; - - case '2': - var valueProcessing = parseFloat(parseFloat($scope.value).toFixed(2)); - var valueFormatted = numberWithCommas(valueProcessing); - buildAmount(valueFormatted, '', ''); - break; - - case '3': - var valueProcessing = parseFloat(parseFloat($scope.value).toFixed(3)); - var valueFormatted = numberWithCommas(valueProcessing); - buildAmount(valueFormatted, '', ''); - break; - - case '8': - var valueFormatted = parseFloat($scope.value).toFixed(8); - if (parseFloat($scope.value) == 0) { - buildAmount('0', '', ''); - } else { - buildAmount(valueFormatted, '', ''); - var start = numberWithCommas(valueFormatted.slice(0, -5)); - var middle = valueFormatted.slice(-5, -2); - var end = valueFormatted.substr(valueFormatted.length - 2); - buildAmount(start, middle, end); - } - break; - } - }] - }; - } -]); \ No newline at end of file diff --git a/src/sass/components/amount.scss b/src/sass/components/amount.scss deleted file mode 100644 index d8fe552a2..000000000 --- a/src/sass/components/amount.scss +++ /dev/null @@ -1,27 +0,0 @@ -.amount { - .start, - .middle, - .end, - .currency { - display: inline-block; - } - - .start { - font-size: 1em; - } - - .middle { - font-size: 0.7857em; - margin-left: 5px; - } - - .end { - font-size: 0.7857em; - margin-left: 5px; - } - - .currency { - font-size: 1em; - margin-left: 5px; - } -} \ No newline at end of file diff --git a/src/sass/components/components.scss b/src/sass/components/components.scss index 8d8346265..a689138bf 100644 --- a/src/sass/components/components.scss +++ b/src/sass/components/components.scss @@ -8,4 +8,3 @@ @import "action-minor"; @import "expand-content"; @import "fee-summary"; -@import "amount"; diff --git a/www/css/main.css b/www/css/main.css index 3b7ddca9d..f059eeaac 100644 --- a/www/css/main.css +++ b/www/css/main.css @@ -15241,27 +15241,6 @@ ion-content.padded-bottom-cta-with-summary { .fee-summary .fee-crypto { color: #A7A7A7; } -.amount .start, -.amount .middle, -.amount .end, -.amount .currency { - display: inline-block; } - -.amount .start { - font-size: 1em; } - -.amount .middle { - font-size: 0.7857em; - margin-left: 5px; } - -.amount .end { - font-size: 0.7857em; - margin-left: 5px; } - -.amount .currency { - font-size: 1em; - margin-left: 5px; } - /* This is for rules that don't yet have a home. * Our goal is to delete this file. Search the regex: /class=".*CLASS.*?"/ */