mirror of https://github.com/BTCPrivate/copay.git
Fixes: number variables forced to be a Number type.
This commit is contained in:
parent
b221bb16d4
commit
f379ee95c0
|
@ -40,12 +40,12 @@ angular.module('copayApp.directives')
|
|||
.directive('enoughAmount', ['$rootScope',
|
||||
function($rootScope) {
|
||||
var bitcore = require('bitcore');
|
||||
var feeSat = bitcore.TransactionBuilder.FEE_PER_1000B_SAT;
|
||||
var feeSat = Number(bitcore.TransactionBuilder.FEE_PER_1000B_SAT);
|
||||
return {
|
||||
require: 'ngModel',
|
||||
link: function(scope, element, attrs, ctrl) {
|
||||
var val = function(value) {
|
||||
var availableBalanceNum = ($rootScope.availableBalance * config.unitToSatoshi).toFixed(0);
|
||||
var availableBalanceNum = Number(($rootScope.availableBalance * config.unitToSatoshi).toFixed(0));
|
||||
var vNum = Number((value * config.unitToSatoshi).toFixed(0)) + feeSat;
|
||||
if (typeof vNum == "number" && vNum > 0) {
|
||||
if (availableBalanceNum < vNum) {
|
||||
|
|
Loading…
Reference in New Issue