Fixed amount values: decimal is variable, depending of unit in config. Also custom values are allowed

This commit is contained in:
Gustavo Cortez 2014-06-27 02:46:28 -03:00
commit 75b45d2f17
4 changed files with 97 additions and 28 deletions

View file

@ -193,9 +193,9 @@ angular.module('copayApp.services')
var COIN = bitcore.util.COIN;
$rootScope.totalBalance = balanceSat * satToUnit;
$rootScope.totalBalanceBTC = (balanceSat / COIN).toFixed(4);
$rootScope.totalBalanceBTC = (balanceSat / COIN);
$rootScope.availableBalance = safeBalanceSat * satToUnit;
$rootScope.availableBalanceBTC = (safeBalanceSat / COIN).toFixed(4);
$rootScope.availableBalanceBTC = (safeBalanceSat / COIN);
var balanceByAddr = {};
for (var ii in balanceByAddrSat) {
balanceByAddr[ii] = balanceByAddrSat[ii] * satToUnit;