Enable SendMax to top up debit card

This commit is contained in:
Gustavo Maximiliano Cortez 2017-04-16 22:23:20 -03:00
commit 28ef9a22dc
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
5 changed files with 81 additions and 15 deletions

View file

@ -184,5 +184,13 @@ angular.module('copayApp.services').factory('txFormatService', function($filter,
};
};
root.satToUnit = function(amount) {
var config = configService.getSync().wallet.settings;
var unitToSatoshi = config.unitToSatoshi;
var satToUnit = 1 / unitToSatoshi;
var unitDecimals = config.unitDecimals;
return parseFloat((amount * satToUnit).toFixed(unitDecimals));
};
return root;
});