Fixes: number variables forced to be a Number type.
This commit is contained in:
parent
b221bb16d4
commit
f379ee95c0
1 changed files with 2 additions and 2 deletions
|
|
@ -40,12 +40,12 @@ angular.module('copayApp.directives')
|
||||||
.directive('enoughAmount', ['$rootScope',
|
.directive('enoughAmount', ['$rootScope',
|
||||||
function($rootScope) {
|
function($rootScope) {
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore');
|
||||||
var feeSat = bitcore.TransactionBuilder.FEE_PER_1000B_SAT;
|
var feeSat = Number(bitcore.TransactionBuilder.FEE_PER_1000B_SAT);
|
||||||
return {
|
return {
|
||||||
require: 'ngModel',
|
require: 'ngModel',
|
||||||
link: function(scope, element, attrs, ctrl) {
|
link: function(scope, element, attrs, ctrl) {
|
||||||
var val = function(value) {
|
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;
|
var vNum = Number((value * config.unitToSatoshi).toFixed(0)) + feeSat;
|
||||||
if (typeof vNum == "number" && vNum > 0) {
|
if (typeof vNum == "number" && vNum > 0) {
|
||||||
if (availableBalanceNum < vNum) {
|
if (availableBalanceNum < vNum) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue