diff --git a/resources/views/master.blade.php b/resources/views/master.blade.php index 6b2ee02fe..987bd7a4d 100644 --- a/resources/views/master.blade.php +++ b/resources/views/master.blade.php @@ -62,6 +62,24 @@ NINJA.isRegistered = {{ \Utils::isRegistered() ? 'true' : 'false' }}; NINJA.loggedErrorCount = 0; + NINJA.parseFloat = function(str) { + if (! str) { + return ''; + } else { + str = str + ''; + } + + // check for comma as decimal separator + if (str.match(/,[\d]{1,2}$/)) { + str = str.replace(',', '.'); + str = str.replace('.', ','); + } + + str = str.replace(/[^0-9\.\-]/g, ''); + + return window.parseFloat(str); + } + window.onerror = function (errorMsg, url, lineNumber, column, error) { if (NINJA.loggedErrorCount > 5) { return; @@ -306,24 +324,6 @@