From 73809d64c1769ec2c80e101ad1f6e601d0458066 Mon Sep 17 00:00:00 2001 From: Michal Taborsky Date: Mon, 8 Jun 2026 19:40:52 +0200 Subject: [PATCH] Update formatted number string to int parsing to fix different locales (#436) --- gui/static/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/static/helpers.js b/gui/static/helpers.js index 7e7d5d3..80b21e2 100644 --- a/gui/static/helpers.js +++ b/gui/static/helpers.js @@ -1,6 +1,6 @@ //HELPER FUNCTIONS function byId(id){ return document.getElementById(id) } -String.prototype.toInt = function(){ return parseInt(this.replace(/,/g,''))} +String.prototype.toInt = function(){ return parseInt(this.replace(/[^\d-]/g,''))} String.prototype.toBool = function(if_false = 0){ return this && /^true$/i.test(this) ? 1 : if_false} Number.prototype.intcomma = function(){ return parseInt(this).toLocaleString() } HTMLElement.prototype.defaultCloneNode = HTMLElement.prototype.cloneNode