Update formatted number string to int parsing to fix different locales (#436)

This commit is contained in:
Michal Taborsky 2026-06-08 19:40:52 +02:00 committed by GitHub
parent bb51c33990
commit 73809d64c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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