diff --git a/public/views/modals/customized-amount.html b/public/views/modals/customized-amount.html
index d37f32dd5..8981f5738 100644
--- a/public/views/modals/customized-amount.html
+++ b/public/views/modals/customized-amount.html
@@ -53,8 +53,8 @@
Amount
@@ -63,8 +63,8 @@
diff --git a/public/views/walletHome.html b/public/views/walletHome.html
index a68d4fa86..06a71249e 100644
--- a/public/views/walletHome.html
+++ b/public/views/walletHome.html
@@ -382,8 +382,11 @@
Amount
@@ -391,8 +394,11 @@
diff --git a/src/js/directives/directives.js b/src/js/directives/directives.js
index 5696fd116..78376c647 100644
--- a/src/js/directives/directives.js
+++ b/src/js/directives/directives.js
@@ -87,22 +87,22 @@ angular.module('copayApp.directives')
])
.directive('validAmount', ['configService', '$locale',
function(configService, locale) {
- var formats = locale.NUMBER_FORMATS;
return {
require: 'ngModel',
link: function(scope, element, attrs, ctrl) {
var val = function(value) {
+ if (value) value = value.replace(/,/g, '.');
var settings = configService.getSync().wallet.settings;
var vNum = Number((value * settings.unitToSatoshi).toFixed(0));
- if (typeof value == 'undefined') {
+ if (typeof value == 'undefined' || value == 0) {
ctrl.$pristine = true;
}
if (typeof vNum == "number" && vNum > 0) {
var decimals = Number(settings.unitDecimals);
- var sep_index = ('' + value).indexOf(formats.DECIMAL_SEP);
+ var sep_index = ('' + value).indexOf('.');
var str_value = ('' + value).substring(sep_index + 1);
if (sep_index > 0 && str_value.length > decimals) {
ctrl.$setValidity('validAmount', false);