Fix amount input (angular directive)

This commit is contained in:
Gustavo Maximiliano Cortez 2014-12-02 17:06:22 -03:00 committed by bechi
commit 29f4e91423
2 changed files with 3 additions and 4 deletions

View file

@ -91,15 +91,14 @@ angular.module('copayApp.directives')
])
.directive('validAmount', ['$rootScope', '$locale',
function($rootScope, locale) {
var w = $rootScope.wallet;
preconditions.checkState(w);
preconditions.checkState(w.settings.unitToSatoshi);
var formats = locale.NUMBER_FORMATS;
return {
require: 'ngModel',
link: function(scope, element, attrs, ctrl) {
var val = function(value) {
var w = $rootScope.wallet;
preconditions.checkState(w);
var vNum = Number((value * w.settings.unitToSatoshi).toFixed(0));
if (typeof value == 'undefined') {