From feaa71c951e7a6d542fa7388162bdfc2dd1589b9 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 31 Jul 2014 17:01:35 -0700 Subject: [PATCH] paypro: total now working. --- js/directives.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/js/directives.js b/js/directives.js index 9a4b39068..195338dca 100644 --- a/js/directives.js +++ b/js/directives.js @@ -34,14 +34,25 @@ angular.module('copayApp.directives') }); } + // XXX good + // total = bignum + // .fromBuffer(total, { + // endian: 'little', + // size: 1 + // }) + // .div(config.unitToSatoshi) + // .toString(10); + total = bignum .fromBuffer(total, { endian: 'little', size: 1 }) - .div(config.unitToSatoshi) .toString(10); + // XXX bad + total = +total / config.unitToSatoshi; + var amount = angular.element( document.querySelector('input#amount')); amount.val(total); @@ -60,7 +71,7 @@ angular.module('copayApp.directives') tamount.html(total + ' (CA: ' + ca + '. Expires: ' + expires.toISOString() - + '): ' + memo); + + ')'); var submit = angular.element( document.querySelector('button[type=submit]'));