From caefd8d172a64f690d7d8df9b863ce19e368a936 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 23 Dec 2016 15:20:29 -0300 Subject: [PATCH 1/2] fix format amount --- src/js/services/txFormatService.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js/services/txFormatService.js b/src/js/services/txFormatService.js index e0a2f9bff..f298a255d 100644 --- a/src/js/services/txFormatService.js +++ b/src/js/services/txFormatService.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.services').factory('txFormatService', function(bwcService, rateService, configService, lodash) { +angular.module('copayApp.services').factory('txFormatService', function($filter, bwcService, rateService, configService, lodash) { var root = {}; root.Utils = bwcService.getUtils(); @@ -48,10 +48,11 @@ angular.module('copayApp.services').factory('txFormatService', function(bwcServi var config = configService.getSync().wallet.settings; var val = function() { - var v1 = rateService.toFiat(satoshis, config.alternativeIsoCode); + var v1 = parseFloat((rateService.toFiat(satoshis, config.alternativeIsoCode)).toFixed(2), 10); + v1 = $filter('formatFiatAmount')(v1); if (!v1) return null; - return v1.toFixed(2) + ' ' + config.alternativeIsoCode; + return v1 + ' ' + config.alternativeIsoCode; }; // Async version From 9522897c044d031cbbbd94df6787730cfbdbb26f Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 27 Dec 2016 10:09:04 -0300 Subject: [PATCH 2/2] remove parameter at parseFloat function --- src/js/services/txFormatService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/services/txFormatService.js b/src/js/services/txFormatService.js index f298a255d..edf2d4315 100644 --- a/src/js/services/txFormatService.js +++ b/src/js/services/txFormatService.js @@ -48,7 +48,7 @@ angular.module('copayApp.services').factory('txFormatService', function($filter, var config = configService.getSync().wallet.settings; var val = function() { - var v1 = parseFloat((rateService.toFiat(satoshis, config.alternativeIsoCode)).toFixed(2), 10); + var v1 = parseFloat((rateService.toFiat(satoshis, config.alternativeIsoCode)).toFixed(2)); v1 = $filter('formatFiatAmount')(v1); if (!v1) return null;