From caefd8d172a64f690d7d8df9b863ce19e368a936 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 23 Dec 2016 15:20:29 -0300 Subject: [PATCH] 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